var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

!function (e, n) {
  "function" == typeof define && (define.amd || define.cmd) ? define(function () {
    return n(e);
  }) : n(e, !0);
}(this, function (e, n) {
  function i(n, i, t) {
    e.WeixinJSBridge ? WeixinJSBridge.invoke(n, o(i), function (e) {
      c(n, e, t);
    }) : l(n, t);
  }function t(n, i, t) {
    e.WeixinJSBridge ? WeixinJSBridge.on(n, function (e) {
      t && t.trigger && t.trigger(e), c(n, e, i);
    }) : t ? l(n, t) : l(n, i);
  }function o(e) {
    return e = e || {}, e.appId = A.appId, e.verifyAppId = A.appId, e.verifySignType = "sha1", e.verifyTimestamp = A.timestamp + "", e.verifyNonceStr = A.nonceStr, e.verifySignature = A.signature, e;
  }function r(e) {
    return { timeStamp: e.timestamp + "", nonceStr: e.nonceStr, package: e.package, paySign: e.paySign, signType: e.signType || "SHA1" };
  }function a(e) {
    return e.postalCode = e.addressPostalCode, delete e.addressPostalCode, e.provinceName = e.proviceFirstStageName, delete e.proviceFirstStageName, e.cityName = e.addressCitySecondStageName, delete e.addressCitySecondStageName, e.countryName = e.addressCountiesThirdStageName, delete e.addressCountiesThirdStageName, e.detailInfo = e.addressDetailInfo, delete e.addressDetailInfo, e;
  }function c(e, n, i) {
    "openEnterpriseChat" == e && (n.errCode = n.err_code), delete n.err_code, delete n.err_desc, delete n.err_detail;var t = n.errMsg;t || (t = n.err_msg, delete n.err_msg, t = s(e, t), n.errMsg = t), (i = i || {})._complete && (i._complete(n), delete i._complete), t = n.errMsg || "", A.debug && !i.isInnerInvoke && alert(JSON.stringify(n));var o = t.indexOf(":");switch (t.substring(o + 1)) {case "ok":
        i.success && i.success(n);break;case "cancel":
        i.cancel && i.cancel(n);break;default:
        i.fail && i.fail(n);}i.complete && i.complete(n);
  }function s(e, n) {
    var i = e,
        t = h[i];t && (i = t);var o = "ok";if (n) {
      var r = n.indexOf(":");"confirm" == (o = n.substring(r + 1)) && (o = "ok"), "failed" == o && (o = "fail"), -1 != o.indexOf("failed_") && (o = o.substring(7)), -1 != o.indexOf("fail_") && (o = o.substring(5)), "access denied" != (o = (o = o.replace(/_/g, " ")).toLowerCase()) && "no permission to execute" != o || (o = "permission denied"), "config" == i && "function not exist" == o && (o = "ok"), "" == o && (o = "fail");
    }return n = i + ":" + o;
  }function d(e) {
    if (e) {
      for (var n = 0, i = e.length; n < i; ++n) {
        var t = e[n],
            o = g[t];o && (e[n] = o);
      }return e;
    }
  }function l(e, n) {
    if (!(!A.debug || n && n.isInnerInvoke)) {
      var i = h[e];i && (e = i), n && n._complete && delete n._complete, console.log('"' + e + '",', n || "");
    }
  }function u(e) {
    if (!(_ || w || A.debug || M < "6.0.2" || V.systemType < 0)) {
      var n = new Image();V.appId = A.appId, V.initTime = C.initEndTime - C.initStartTime, V.preVerifyTime = C.preVerifyEndTime - C.preVerifyStartTime, N.getNetworkType({ isInnerInvoke: !0, success: function success(e) {
          V.networkType = e.networkType;var i = "https://open.weixin.qq.com/sdk/report?v=" + V.version + "&o=" + V.isPreVerifyOk + "&s=" + V.systemType + "&c=" + V.clientVersion + "&a=" + V.appId + "&n=" + V.networkType + "&i=" + V.initTime + "&p=" + V.preVerifyTime + "&u=" + V.url;n.src = i;
        } });
    }
  }function p() {
    return new Date().getTime();
  }function f(n) {
    T && (e.WeixinJSBridge ? n() : S.addEventListener && S.addEventListener("WeixinJSBridgeReady", n, !1));
  }function m() {
    N.invoke || (N.invoke = function (n, i, t) {
      e.WeixinJSBridge && WeixinJSBridge.invoke(n, o(i), t);
    }, N.on = function (n, i) {
      e.WeixinJSBridge && WeixinJSBridge.on(n, i);
    });
  }if (!e.jWeixin) {
    var _N;

    var g = { config: "preVerifyJSAPI", onMenuShareTimeline: "menu:share:timeline", onMenuShareAppMessage: "menu:share:appmessage", onMenuShareQQ: "menu:share:qq", onMenuShareWeibo: "menu:share:weiboApp", onMenuShareQZone: "menu:share:QZone", previewImage: "imagePreview", getLocation: "geoLocation", openProductSpecificView: "openProductViewWithPid", addCard: "batchAddCard", openCard: "batchViewCard", chooseWXPay: "getBrandWCPayRequest", openEnterpriseRedPacket: "getRecevieBizHongBaoRequest", startSearchBeacons: "startMonitoringBeacons", stopSearchBeacons: "stopMonitoringBeacons", onSearchBeacons: "onBeaconsInRange", consumeAndShareCard: "consumedShareCard", openAddress: "editAddress" },
        h = function () {
      var e = {};for (var n in g) {
        e[g[n]] = n;
      }return e;
    }(),
        S = e.document,
        v = S.title,
        y = navigator.userAgent.toLowerCase(),
        I = navigator.platform.toLowerCase(),
        _ = !(!I.match("mac") && !I.match("win")),
        w = -1 != y.indexOf("wxdebugger"),
        T = -1 != y.indexOf("micromessenger"),
        k = -1 != y.indexOf("android"),
        x = -1 != y.indexOf("iphone") || -1 != y.indexOf("ipad"),
        M = function () {
      var e = y.match(/micromessenger\/(\d+\.\d+\.\d+)/) || y.match(/micromessenger\/(\d+\.\d+)/);return e ? e[1] : "";
    }(),
        C = { initStartTime: p(), initEndTime: 0, preVerifyStartTime: 0, preVerifyEndTime: 0 },
        V = { version: 1, appId: "", initTime: 0, preVerifyTime: 0, networkType: "", isPreVerifyOk: 1, systemType: x ? 1 : k ? 2 : -1, clientVersion: M, url: encodeURIComponent(location.href) },
        A = {},
        P = { _completes: [] },
        L = { state: 0, data: {} };f(function () {
      C.initEndTime = p();
    });var B = !1,
        O = [],
        N = (_N = { config: function config(e) {
        A = e, l("config", e);var n = !1 !== A.check;f(function () {
          if (n) i(g.config, { verifyJsApiList: d(A.jsApiList) }, function () {
            P._complete = function (e) {
              C.preVerifyEndTime = p(), L.state = 1, L.data = e;
            }, P.success = function (e) {
              V.isPreVerifyOk = 0;
            }, P.fail = function (e) {
              P._fail ? P._fail(e) : L.state = -1;
            };var e = P._completes;return e.push(function () {
              u();
            }), P.complete = function (n) {
              for (var i = 0, t = e.length; i < t; ++i) {
                e[i]();
              }P._completes = [];
            }, P;
          }()), C.preVerifyStartTime = p();else {
            L.state = 1;for (var e = P._completes, t = 0, o = e.length; t < o; ++t) {
              e[t]();
            }P._completes = [];
          }
        }), A.beta && m();
      }, ready: function ready(e) {
        0 != L.state ? e() : (P._completes.push(e), !T && A.debug && e());
      }, error: function error(e) {
        M < "6.0.2" || (-1 == L.state ? e(L.data) : P._fail = e);
      }, checkJsApi: function checkJsApi(e) {
        var n = function n(e) {
          var n = e.checkResult;for (var i in n) {
            var t = h[i];t && (n[t] = n[i], delete n[i]);
          }return e;
        };i("checkJsApi", { jsApiList: d(e.jsApiList) }, (e._complete = function (e) {
          if (k) {
            var i = e.checkResult;i && (e.checkResult = JSON.parse(i));
          }e = n(e);
        }, e));
      }, onMenuShareTimeline: function onMenuShareTimeline(e) {
        t(g.onMenuShareTimeline, { complete: function complete() {
            i("shareTimeline", { title: e.title || v, desc: e.title || v, img_url: e.imgUrl || "", link: e.link || location.href, type: e.type || "link", data_url: e.dataUrl || "" }, e);
          } }, e);
      }, onMenuShareAppMessage: function onMenuShareAppMessage(e) {
        t(g.onMenuShareAppMessage, { complete: function complete(n) {
            "favorite" === n.scene ? i("sendAppMessage", { title: e.title || v, desc: e.desc || "", link: e.link || location.href, img_url: e.imgUrl || "", type: e.type || "link", data_url: e.dataUrl || "" }) : i("sendAppMessage", { title: e.title || v, desc: e.desc || "", link: e.link || location.href, img_url: e.imgUrl || "", type: e.type || "link", data_url: e.dataUrl || "" }, e);
          } }, e);
      }, onMenuShareQQ: function onMenuShareQQ(e) {
        t(g.onMenuShareQQ, { complete: function complete() {
            i("shareQQ", { title: e.title || v, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);
          } }, e);
      }, onMenuShareWeibo: function onMenuShareWeibo(e) {
        t(g.onMenuShareWeibo, { complete: function complete() {
            i("shareWeiboApp", { title: e.title || v, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);
          } }, e);
      }, onMenuShareQZone: function onMenuShareQZone(e) {
        t(g.onMenuShareQZone, { complete: function complete() {
            i("shareQZone", { title: e.title || v, desc: e.desc || "", img_url: e.imgUrl || "", link: e.link || location.href }, e);
          } }, e);
      }, startRecord: function startRecord(e) {
        i("startRecord", {}, e);
      }, stopRecord: function stopRecord(e) {
        i("stopRecord", {}, e);
      }, onVoiceRecordEnd: function onVoiceRecordEnd(e) {
        t("onVoiceRecordEnd", e);
      }, playVoice: function playVoice(e) {
        i("playVoice", { localId: e.localId }, e);
      }, pauseVoice: function pauseVoice(e) {
        i("pauseVoice", { localId: e.localId }, e);
      }, stopVoice: function stopVoice(e) {
        i("stopVoice", { localId: e.localId }, e);
      }, onVoicePlayEnd: function onVoicePlayEnd(e) {
        t("onVoicePlayEnd", e);
      }, uploadVoice: function uploadVoice(e) {
        i("uploadVoice", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);
      }, downloadVoice: function downloadVoice(e) {
        i("downloadVoice", { serverId: e.serverId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);
      }, translateVoice: function translateVoice(e) {
        i("translateVoice", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);
      }, chooseImage: function chooseImage(e) {
        i("chooseImage", { scene: "1|2", count: e.count || 9, sizeType: e.sizeType || ["original", "compressed"], sourceType: e.sourceType || ["album", "camera"] }, (e._complete = function (e) {
          if (k) {
            var n = e.localIds;n && (e.localIds = JSON.parse(n));
          }
        }, e));
      }, getLocation: function getLocation(e) {}, previewImage: function previewImage(e) {
        i(g.previewImage, { current: e.current, urls: e.urls }, e);
      }, uploadImage: function uploadImage(e) {
        i("uploadImage", { localId: e.localId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);
      }, downloadImage: function downloadImage(e) {
        i("downloadImage", { serverId: e.serverId, isShowProgressTips: 0 == e.isShowProgressTips ? 0 : 1 }, e);
      }, getLocalImgData: function getLocalImgData(e) {
        !1 === B ? (B = !0, i("getLocalImgData", { localId: e.localId }, (e._complete = function (e) {
          if (B = !1, O.length > 0) {
            var n = O.shift();wx.getLocalImgData(n);
          }
        }, e))) : O.push(e);
      }, getNetworkType: function getNetworkType(e) {
        var n = function n(e) {
          var n = e.errMsg;e.errMsg = "getNetworkType:ok";var i = e.subtype;if (delete e.subtype, i) e.networkType = i;else {
            var t = n.indexOf(":"),
                o = n.substring(t + 1);switch (o) {case "wifi":case "edge":case "wwan":
                e.networkType = o;break;default:
                e.errMsg = "getNetworkType:fail";}
          }return e;
        };i("getNetworkType", {}, (e._complete = function (e) {
          e = n(e);
        }, e));
      }, openLocation: function openLocation(e) {
        i("openLocation", { latitude: e.latitude, longitude: e.longitude, name: e.name || "", address: e.address || "", scale: e.scale || 28, infoUrl: e.infoUrl || "" }, e);
      } }, _defineProperty(_N, "getLocation", function getLocation(e) {
      e = e || {}, i(g.getLocation, { type: e.type || "wgs84" }, (e._complete = function (e) {
        delete e.type;
      }, e));
    }), _defineProperty(_N, "hideOptionMenu", function hideOptionMenu(e) {
      i("hideOptionMenu", {}, e);
    }), _defineProperty(_N, "showOptionMenu", function showOptionMenu(e) {
      i("showOptionMenu", {}, e);
    }), _defineProperty(_N, "closeWindow", function closeWindow(e) {
      i("closeWindow", {}, e = e || {});
    }), _defineProperty(_N, "hideMenuItems", function hideMenuItems(e) {
      i("hideMenuItems", { menuList: e.menuList }, e);
    }), _defineProperty(_N, "showMenuItems", function showMenuItems(e) {
      i("showMenuItems", { menuList: e.menuList }, e);
    }), _defineProperty(_N, "hideAllNonBaseMenuItem", function hideAllNonBaseMenuItem(e) {
      i("hideAllNonBaseMenuItem", {}, e);
    }), _defineProperty(_N, "showAllNonBaseMenuItem", function showAllNonBaseMenuItem(e) {
      i("showAllNonBaseMenuItem", {}, e);
    }), _defineProperty(_N, "scanQRCode", function scanQRCode(e) {
      i("scanQRCode", { needResult: (e = e || {}).needResult || 0, scanType: e.scanType || ["qrCode", "barCode"] }, (e._complete = function (e) {
        if (x) {
          var n = e.resultStr;if (n) {
            var i = JSON.parse(n);e.resultStr = i && i.scan_code && i.scan_code.scan_result;
          }
        }
      }, e));
    }), _defineProperty(_N, "openAddress", function openAddress(e) {
      i(g.openAddress, {}, (e._complete = function (e) {
        e = a(e);
      }, e));
    }), _defineProperty(_N, "openProductSpecificView", function openProductSpecificView(e) {
      i(g.openProductSpecificView, { pid: e.productId, view_type: e.viewType || 0, ext_info: e.extInfo }, e);
    }), _defineProperty(_N, "addCard", function addCard(e) {
      for (var n = e.cardList, t = [], o = 0, r = n.length; o < r; ++o) {
        var a = n[o],
            c = { card_id: a.cardId, card_ext: a.cardExt };t.push(c);
      }i(g.addCard, { card_list: t }, (e._complete = function (e) {
        var n = e.card_list;if (n) {
          for (var i = 0, t = (n = JSON.parse(n)).length; i < t; ++i) {
            var o = n[i];o.cardId = o.card_id, o.cardExt = o.card_ext, o.isSuccess = !!o.is_succ, delete o.card_id, delete o.card_ext, delete o.is_succ;
          }e.cardList = n, delete e.card_list;
        }
      }, e));
    }), _defineProperty(_N, "chooseCard", function chooseCard(e) {
      i("chooseCard", { app_id: A.appId, location_id: e.shopId || "", sign_type: e.signType || "SHA1", card_id: e.cardId || "", card_type: e.cardType || "", card_sign: e.cardSign, time_stamp: e.timestamp + "", nonce_str: e.nonceStr }, (e._complete = function (e) {
        e.cardList = e.choose_card_info, delete e.choose_card_info;
      }, e));
    }), _defineProperty(_N, "openCard", function openCard(e) {
      for (var n = e.cardList, t = [], o = 0, r = n.length; o < r; ++o) {
        var a = n[o],
            c = { card_id: a.cardId, code: a.code };t.push(c);
      }i(g.openCard, { card_list: t }, e);
    }), _defineProperty(_N, "consumeAndShareCard", function consumeAndShareCard(e) {
      i(g.consumeAndShareCard, { consumedCardId: e.cardId, consumedCode: e.code }, e);
    }), _defineProperty(_N, "chooseWXPay", function chooseWXPay(e) {
      i(g.chooseWXPay, r(e), e);
    }), _defineProperty(_N, "openEnterpriseRedPacket", function openEnterpriseRedPacket(e) {
      i(g.openEnterpriseRedPacket, r(e), e);
    }), _defineProperty(_N, "startSearchBeacons", function startSearchBeacons(e) {
      i(g.startSearchBeacons, { ticket: e.ticket }, e);
    }), _defineProperty(_N, "stopSearchBeacons", function stopSearchBeacons(e) {
      i(g.stopSearchBeacons, {}, e);
    }), _defineProperty(_N, "onSearchBeacons", function onSearchBeacons(e) {
      t(g.onSearchBeacons, e);
    }), _defineProperty(_N, "openEnterpriseChat", function openEnterpriseChat(e) {
      i("openEnterpriseChat", { useridlist: e.userIds, chatname: e.groupName }, e);
    }), _N),
        E = 1,
        b = {};return S.addEventListener("error", function (e) {
      if (!k) {
        var n = e.target,
            i = n.tagName,
            t = n.src;if (("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) && -1 != t.indexOf("wxlocalresource://")) {
          e.preventDefault(), e.stopPropagation();var o = n["wx-id"];if (o || (o = E++, n["wx-id"] = o), b[o]) return;b[o] = !0, wx.ready(function () {
            wx.getLocalImgData({ localId: t, success: function success(e) {
                n.src = e.localData;
              } });
          });
        }
      }
    }, !0), S.addEventListener("load", function (e) {
      if (!k) {
        var n = e.target,
            i = n.tagName;n.src;if ("IMG" == i || "VIDEO" == i || "AUDIO" == i || "SOURCE" == i) {
          var t = n["wx-id"];t && (b[t] = !1);
        }
      }
    }, !0), n && (e.wx = e.jWeixin = N), N;
  }
});
var config = {
  APPID: 'wx27900e3078720b6f',
  socialType: 'wx-jqfx',
  apiUrl: 'https://gate.97kid.com',
  staticUrl: 'https://gstatic.97kid.com',
  requestTimeout: 20000,
  appId: 'antYy9lOFi5mkU9QKjtYmRLM-gzGzoHsz',
  appKey: 'jqyWxLyobpsmdwsJddJlDheb'
};

function checkWxExist() {
  return (typeof wx === "undefined" ? "undefined" : _typeof(wx)) === 'object';
}

function WxConfig(options, campaign, random) {
  checkWxExist() && wx.config({
    debug: false,
    appId: config.APPID,
    timestamp: options.timestamp,
    nonceStr: options.nonceStr,
    signature: options.signature,
    jsApiList: options.jsApiList
  });

  checkWxExist() && wx.error(function (res) {
    console.log('微信验证失败 ' + JSON.stringify(res));
  });

  var shareMsg = {
    title: options.title || '【Qkids久趣】4-12岁，在家跟北美外教学英语，新用户100元体验！',
    desc: options.desc || '严选北美外教在线授课，创造趣味十足的课堂体验，让孩子爱学更有效。',
    link: options.link || window.location.protocol + '//' + window.location.host + '/wx',
    imgUrl: options.imgUrl || 'https://static-app.97kid.com/site-student/public/img/share.png',

    success: function success() {},
    fail: function fail(res) {
      // $.toastAlert('微信分享朋友圈失败: ' + JSON.stringify(res));
    }
  };

  switch (campaign) {
    case 'doubleeleven':
      shareMsg.title = '【双11】久趣148元/8课时！在家跟北美外教学英语。';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/doubleeleven' + Math.ceil(Math.random() * 100);
      break;
    case 'christmas':
      shareMsg.title = '【久趣英语圣诞主题课】9.9元和北美外教过圣诞！';
      shareMsg.desc = '4-12岁在线上课，4人成团。快来唱圣诞歌，体验地道圣诞文化！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/christmas' + Math.ceil(Math.random() * 100);
      break;
    case 'winterclass':
      shareMsg.title = '【久趣148元/10课时】寒假在家跟北美外教学英语';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/winterclass' + Math.ceil(Math.random() * 100);
      break;
    case 'award':
      shareMsg.title = '【久趣特惠团购】给4-12岁儿童的北美外教超值英语课！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/award' + Math.ceil(Math.random() * 100);
      break;
    case 'easter':
      shareMsg.title = '【久趣英语复活节主题课】19.9元，北美外教带你画彩蛋！';
      shareMsg.desc = '4-12岁，四人成团，在线上课。快来体验复活节文化，get纯正美语！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/easter' + Math.ceil(Math.random() * 100);
      break;
    case 'easter1':
      shareMsg.title = '【久趣英语复活节主题课】29.9元，北美外教带你画彩蛋！';
      shareMsg.desc = '4-12岁，四人成团，在线上课。快来体验复活节文化，get纯正美语！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/easter1' + Math.ceil(Math.random() * 100);
      break;
    case 'phonics':
      shareMsg.title = '限时！久趣自然拼读，9元解锁2节课！';
      shareMsg.desc = '北美外教在线教学，让孩子轻松认读新单词！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/phonics' + Math.ceil(Math.random() * 100);
      break;
    case 'two':
      shareMsg.title = '【久趣五月2人班】￥360/8次课，严选北美外教在线上课';
      shareMsg.desc = '4-12岁适用，2人成团，严选北美外教在线上课，创造趣味十足的课堂体验。';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/two' + Math.ceil(Math.random() * 100);
      break;
    case 'summer':
      shareMsg.title = '【久趣暑假第一波 |￥168/10节课，在家和北美外教学英语';
      shareMsg.desc = '4-12岁使用，4人成团，严选北美外教在线授课，创造趣味十足的课堂体验。';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/summer' + Math.ceil(Math.random() * 100);
      break;
    case 'summers':
      shareMsg.title = '久趣8月福利|暑假第二波 ￥168/10节课';
      shareMsg.desc = '4-12岁使用，4人成团，在家和北美外教学英语。';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/summers' + Math.ceil(Math.random() * 100);
      break;
    case 'summer2s':
      shareMsg.title = '久趣暑期特惠｜¥168/10节课，在家和北美外教学英语！';
      shareMsg.desc = '适合4-12岁，零基础的小朋友也可轻松学会！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/summer2s' + Math.ceil(Math.random() * 100);
      break;
    case 'summer3s':
      shareMsg.title = '久趣暑期特惠｜¥168/10节课，在家和北美外教学英语！';
      shareMsg.desc = '适合4-12岁，零基础的小朋友也可轻松学会！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/summer3s' + Math.ceil(Math.random() * 100);
      break;
    case 'insect':
      shareMsg.title = '19.9元4节「久趣昆虫主题课」北美外教带你探索"昆虫的秘密"！';
      shareMsg.desc = '4-12岁，三人成团，在线上课。一起走进奥妙的昆虫世界，get纯正美语！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/insect' + Math.ceil(Math.random() * 100);
      break;
    case 'invite':
      shareMsg.title = '送你1节孩子最爱的北美外教课，免费哟~';
      shareMsg.desc = '快来跟我们做同学吧~';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/invite' + Math.ceil(Math.random() * 100);
      break;
    case 'lottery':
      shareMsg.title = '【久趣福利】1元抢3节北美外教课！';
      shareMsg.desc = '100%北美外教在线教学，让孩子爱上英语！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/lottery' + Math.ceil(Math.random() * 100);
      shareMsg.imgUrl = 'https://static-app.97kid.com/site-student/public/mobile/campaign/lottery/img/share.jpg';
      break;
    case '1v1':
      shareMsg.title = '【5折福利】久趣1对1北美精英外教在线教学，仅500名额！';
      shareMsg.desc = '适合4-12岁，专属外教固定时间，让孩子爱上英语！';
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/one' + Math.ceil(Math.random() * 100);
      shareMsg.imgUrl = 'https://static-app.97kid.com/site-student/public/mobile/campaign/1v1/img/share.jpg';
      break;
    default:
      shareMsg.title = '【Qkids久趣】4-12岁，在家跟北美外教学英语，新用户100元体验！';
      shareMsg.desc = '严选北美外教在线授课，创造趣味十足的课堂体验，让孩子爱学更有效。';
      shareMsg.link = options.link || window.location.protocol + '//' + window.location.host + '/wx';
      break;
  }

  function patchShareMsg(shareMsg, target) {
    var defaultSuccessFunction = shareMsg.success;
    return {
      title: shareMsg.title,
      desc: shareMsg.desc,
      link: shareMsg.link,
      imgUrl: shareMsg.imgUrl,
      success: function success() {
        if (window.AV && window.AV.analytics instanceof Function) {
          var appId = 'antYy9lOFi5mkU9QKjtYmRLM-gzGzoHsz';
          var appKey = 'jqyWxLyobpsmdwsJddJlDheb';

          var analytics = window.AV.analytics({
            appId: appId,
            appKey: appKey,
            channel: 'weixin'
          });
          analytics.send({
            event: 'share',
            attr: {
              url: shareMsg.link,
              target: target
            }
          });
        }
        if (defaultSuccessFunction && typeof defaultSuccessFunction == 'function') {
          defaultSuccessFunction.call(this, target);
        }
      },
      cancel: shareMsg.cancel
    };
  }

  //初始化分享接口
  checkWxExist() && wx.ready(function () {
    wx.onMenuShareTimeline(patchShareMsg(shareMsg, 'timeline'));
    wx.onMenuShareAppMessage(patchShareMsg(shareMsg, 'appMessage'));
    wx.onMenuShareQQ(patchShareMsg(shareMsg, 'QQ'));
    wx.onMenuShareQZone(patchShareMsg(shareMsg, 'QZone'));
  });

  //登陆用户分享接口
  WxConfig.prototype.activeShare = function (shareFlag, camParas, _shareMsg) {
    // campaign 将逐步弃用掉, 改成使用_shareMsg控制
    var extraParas = '';
    for (var para in camParas) {
      extraParas += '&' + para + '=' + camParas[para];
    }
    if (campaign !== undefined && campaign !== '') {
      if (random === undefined) random = true;
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx/' + campaign;
      if (random) {
        shareMsg.link += '/' + Math.ceil(Math.random() * 100);
      }
      shareMsg.link += '?_r=' + shareFlag + extraParas;
    } else {
      shareMsg.link = window.location.protocol + '//' + window.location.host + '/wx?_r=' + shareFlag + extraParas;
    }

    // 今后都将采用_shareMsg控制, _shareMsg将会覆盖上面的配置
    if (_shareMsg) {
      shareMsg = {
        title: _shareMsg.title || shareMsg.title,
        desc: _shareMsg.desc || shareMsg.desc,
        link: _shareMsg.link || shareMsg.link,
        imgUrl: _shareMsg.imgUrl || shareMsg.imgUrl,
        success: _shareMsg.success || shareMsg.success,
        fail: _shareMsg.fail || shareMsg.fail
      };
    }
    checkWxExist() && wx.ready(function () {
      wx.onMenuShareTimeline(patchShareMsg(shareMsg, 'timeline'));
      wx.onMenuShareAppMessage(patchShareMsg(shareMsg, 'appMessage'));
      wx.onMenuShareQQ(patchShareMsg(shareMsg, 'QQ'));
      wx.onMenuShareQZone(patchShareMsg(shareMsg, 'QZone'));
    });
  };

  WxConfig.prototype.pay = function (billId, pId, options, campUrl) {
    checkWxExist() && wx.ready(function () {
      wx.chooseWXPay({
        timestamp: options.timeStamp,
        nonceStr: options.nonceStr,
        package: options.package,
        signType: options.signType,
        paySign: options.paySign,

        // 支付成功后的回调函数
        success: function success(res) {
          if (options.success && typeof options.success === 'function') {
            if (options.success(res)) return;
          }
          if (options.redirect && typeof options.redirect === 'string') {
            if (options.redirect !== '') window.location.href = options.redirect;
          } else {
            //是否为活动
            if (typeof campUrl !== 'undefined') {
              window.location.href = '/wx/verifypayment/' + pId + '?out_trade_no=' + billId + '&campUrl=' + campUrl;
            } else {
              window.location.href = '/wx/verifypayment/' + pId + '?out_trade_no=' + billId;
            }
          }
        },
        // 支付失败后的回调函数
        fail: function fail(res) {
          $.toastAlert('微信支付唤起失败: ' + JSON.stringify(res));
          if (options.fail || options.fail instanceof Function) options.fail(res);
        }
      });
    });
  };
}

/* Zepto v1.0 - polyfill zepto detect event ajax form fx - zeptojs.com/license */
!function (a) {
  String.prototype.trim === a && (String.prototype.trim = function () {
    return this.replace(/^\s+|\s+$/g, "");
  }), Array.prototype.reduce === a && (Array.prototype.reduce = function (b) {
    if (void 0 === this || null === this) throw new TypeError();var c,
        d = Object(this),
        e = d.length >>> 0,
        f = 0;if ("function" != typeof b) throw new TypeError();if (0 == e && 1 == arguments.length) throw new TypeError();if (arguments.length >= 2) c = arguments[1];else for (;;) {
      if (f in d) {
        c = d[f++];break;
      }if (++f >= e) throw new TypeError();
    }for (; e > f;) {
      f in d && (c = b.call(a, c, d[f], f, d)), f++;
    }return c;
  });
}();var Zepto = function () {
  function a(a) {
    return null == a ? String(a) : W[X.call(a)] || "object";
  }function b(b) {
    return "function" == a(b);
  }function c(a) {
    return null != a && a == a.window;
  }function d(a) {
    return null != a && a.nodeType == a.DOCUMENT_NODE;
  }function e(b) {
    return "object" == a(b);
  }function f(a) {
    return e(a) && !c(a) && a.__proto__ == Object.prototype;
  }function g(a) {
    return a instanceof Array;
  }function h(a) {
    return "number" == typeof a.length;
  }function i(a) {
    return E.call(a, function (a) {
      return null != a;
    });
  }function j(a) {
    return a.length > 0 ? y.fn.concat.apply([], a) : a;
  }function k(a) {
    return a.replace(/::/g, "/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/_/g, "-").toLowerCase();
  }function l(a) {
    return a in H ? H[a] : H[a] = new RegExp("(^|\\s)" + a + "(\\s|$)");
  }function m(a, b) {
    return "number" != typeof b || J[k(a)] ? b : b + "px";
  }function n(a) {
    var b, c;return G[a] || (b = F.createElement(a), F.body.appendChild(b), c = I(b, "").getPropertyValue("display"), b.parentNode.removeChild(b), "none" == c && (c = "block"), G[a] = c), G[a];
  }function o(a) {
    return "children" in a ? D.call(a.children) : y.map(a.childNodes, function (a) {
      return 1 == a.nodeType ? a : void 0;
    });
  }function p(a, b, c) {
    for (x in b) {
      c && (f(b[x]) || g(b[x])) ? (f(b[x]) && !f(a[x]) && (a[x] = {}), g(b[x]) && !g(a[x]) && (a[x] = []), p(a[x], b[x], c)) : b[x] !== w && (a[x] = b[x]);
    }
  }function q(a, b) {
    return b === w ? y(a) : y(a).filter(b);
  }function r(a, c, d, e) {
    return b(c) ? c.call(a, d, e) : c;
  }function s(a, b, c) {
    null == c ? a.removeAttribute(b) : a.setAttribute(b, c);
  }function t(a, b) {
    var c = a.className,
        d = c && c.baseVal !== w;return b === w ? d ? c.baseVal : c : void (d ? c.baseVal = b : a.className = b);
  }function u(a) {
    var b;try {
      return a ? "true" == a || ("false" == a ? !1 : "null" == a ? null : isNaN(b = Number(a)) ? /^[\[\{]/.test(a) ? y.parseJSON(a) : a : b) : a;
    } catch (c) {
      return a;
    }
  }function v(a, b) {
    b(a);for (var c in a.childNodes) {
      v(a.childNodes[c], b);
    }
  }var w,
      x,
      y,
      z,
      A,
      B,
      C = [],
      D = C.slice,
      E = C.filter,
      F = window.document,
      G = {},
      H = {},
      I = F.defaultView.getComputedStyle,
      J = { "column-count": 1, columns: 1, "font-weight": 1, "line-height": 1, opacity: 1, "z-index": 1, zoom: 1 },
      K = /^\s*<(\w+|!)[^>]*>/,
      L = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
      M = /^(?:body|html)$/i,
      N = ["val", "css", "html", "text", "data", "width", "height", "offset"],
      O = ["after", "prepend", "before", "append"],
      P = F.createElement("table"),
      Q = F.createElement("tr"),
      R = { tr: F.createElement("tbody"), tbody: P, thead: P, tfoot: P, td: Q, th: Q, "*": F.createElement("div") },
      S = /complete|loaded|interactive/,
      T = /^\.([\w-]+)$/,
      U = /^#([\w-]*)$/,
      V = /^[\w-]+$/,
      W = {},
      X = W.toString,
      Y = {},
      Z = F.createElement("div");return Y.matches = function (a, b) {
    if (!a || 1 !== a.nodeType) return !1;var c = a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.matchesSelector;if (c) return c.call(a, b);var d,
        e = a.parentNode,
        f = !e;return f && (e = Z).appendChild(a), d = ~Y.qsa(e, b).indexOf(a), f && Z.removeChild(a), d;
  }, A = function A(a) {
    return a.replace(/-+(.)?/g, function (a, b) {
      return b ? b.toUpperCase() : "";
    });
  }, B = function B(a) {
    return E.call(a, function (b, c) {
      return a.indexOf(b) == c;
    });
  }, Y.fragment = function (a, b, c) {
    a.replace && (a = a.replace(L, "<$1></$2>")), b === w && (b = K.test(a) && RegExp.$1), b in R || (b = "*");var d,
        e,
        g = R[b];return g.innerHTML = "" + a, e = y.each(D.call(g.childNodes), function () {
      g.removeChild(this);
    }), f(c) && (d = y(e), y.each(c, function (a, b) {
      N.indexOf(a) > -1 ? d[a](b) : d.attr(a, b);
    })), e;
  }, Y.Z = function (a, b) {
    return a = a || [], a.__proto__ = y.fn, a.selector = b || "", a;
  }, Y.isZ = function (a) {
    return a instanceof Y.Z;
  }, Y.init = function (a, c) {
    if (a) {
      if (b(a)) return y(F).ready(a);if (Y.isZ(a)) return a;var d;if (g(a)) d = i(a);else if (e(a)) d = [f(a) ? y.extend({}, a) : a], a = null;else if (K.test(a)) d = Y.fragment(a.trim(), RegExp.$1, c), a = null;else {
        if (c !== w) return y(c).find(a);d = Y.qsa(F, a);
      }return Y.Z(d, a);
    }return Y.Z();
  }, y = function y(a, b) {
    return Y.init(a, b);
  }, y.extend = function (a) {
    var b,
        c = D.call(arguments, 1);return "boolean" == typeof a && (b = a, a = c.shift()), c.forEach(function (c) {
      p(a, c, b);
    }), a;
  }, Y.qsa = function (a, b) {
    var c;return d(a) && U.test(b) ? (c = a.getElementById(RegExp.$1)) ? [c] : [] : 1 !== a.nodeType && 9 !== a.nodeType ? [] : D.call(T.test(b) ? a.getElementsByClassName(RegExp.$1) : V.test(b) ? a.getElementsByTagName(b) : a.querySelectorAll(b));
  }, y.contains = function (a, b) {
    return a !== b && a.contains(b);
  }, y.type = a, y.isFunction = b, y.isWindow = c, y.isArray = g, y.isPlainObject = f, y.isEmptyObject = function (a) {
    var b;for (b in a) {
      return !1;
    }return !0;
  }, y.inArray = function (a, b, c) {
    return C.indexOf.call(b, a, c);
  }, y.camelCase = A, y.trim = function (a) {
    return a.trim();
  }, y.uuid = 0, y.support = {}, y.expr = {}, y.map = function (a, b) {
    var c,
        d,
        e,
        f = [];if (h(a)) for (d = 0; d < a.length; d++) {
      c = b(a[d], d), null != c && f.push(c);
    } else for (e in a) {
      c = b(a[e], e), null != c && f.push(c);
    }return j(f);
  }, y.each = function (a, b) {
    var c, d;if (h(a)) {
      for (c = 0; c < a.length; c++) {
        if (b.call(a[c], c, a[c]) === !1) return a;
      }
    } else for (d in a) {
      if (b.call(a[d], d, a[d]) === !1) return a;
    }return a;
  }, y.grep = function (a, b) {
    return E.call(a, b);
  }, window.JSON && (y.parseJSON = JSON.parse), y.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function (a, b) {
    W["[object " + b + "]"] = b.toLowerCase();
  }), y.fn = { forEach: C.forEach, reduce: C.reduce, push: C.push, sort: C.sort, indexOf: C.indexOf, concat: C.concat, map: function map(a) {
      return y(y.map(this, function (b, c) {
        return a.call(b, c, b);
      }));
    }, slice: function slice() {
      return y(D.apply(this, arguments));
    }, ready: function ready(a) {
      return S.test(F.readyState) ? a(y) : F.addEventListener("DOMContentLoaded", function () {
        a(y);
      }, !1), this;
    }, get: function get(a) {
      return a === w ? D.call(this) : this[a >= 0 ? a : a + this.length];
    }, toArray: function toArray() {
      return this.get();
    }, size: function size() {
      return this.length;
    }, remove: function remove() {
      return this.each(function () {
        null != this.parentNode && this.parentNode.removeChild(this);
      });
    }, each: function each(a) {
      return C.every.call(this, function (b, c) {
        return a.call(b, c, b) !== !1;
      }), this;
    }, filter: function filter(a) {
      return b(a) ? this.not(this.not(a)) : y(E.call(this, function (b) {
        return Y.matches(b, a);
      }));
    }, add: function add(a, b) {
      return y(B(this.concat(y(a, b))));
    }, is: function is(a) {
      return this.length > 0 && Y.matches(this[0], a);
    }, not: function not(a) {
      var c = [];if (b(a) && a.call !== w) this.each(function (b) {
        a.call(this, b) || c.push(this);
      });else {
        var d = "string" == typeof a ? this.filter(a) : h(a) && b(a.item) ? D.call(a) : y(a);this.forEach(function (a) {
          d.indexOf(a) < 0 && c.push(a);
        });
      }return y(c);
    }, has: function has(a) {
      return this.filter(function () {
        return e(a) ? y.contains(this, a) : y(this).find(a).size();
      });
    }, eq: function eq(a) {
      return -1 === a ? this.slice(a) : this.slice(a, +a + 1);
    }, first: function first() {
      var a = this[0];return a && !e(a) ? a : y(a);
    }, last: function last() {
      var a = this[this.length - 1];return a && !e(a) ? a : y(a);
    }, find: function find(a) {
      var b,
          c = this;return b = "object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) ? y(a).filter(function () {
        var a = this;return C.some.call(c, function (b) {
          return y.contains(b, a);
        });
      }) : 1 == this.length ? y(Y.qsa(this[0], a)) : this.map(function () {
        return Y.qsa(this, a);
      });
    }, closest: function closest(a, b) {
      var c = this[0],
          e = !1;for ("object" == (typeof a === "undefined" ? "undefined" : _typeof(a)) && (e = y(a)); c && !(e ? e.indexOf(c) >= 0 : Y.matches(c, a));) {
        c = c !== b && !d(c) && c.parentNode;
      }return y(c);
    }, parents: function parents(a) {
      for (var b = [], c = this; c.length > 0;) {
        c = y.map(c, function (a) {
          return (a = a.parentNode) && !d(a) && b.indexOf(a) < 0 ? (b.push(a), a) : void 0;
        });
      }return q(b, a);
    }, parent: function parent(a) {
      return q(B(this.pluck("parentNode")), a);
    }, children: function children(a) {
      return q(this.map(function () {
        return o(this);
      }), a);
    }, contents: function contents() {
      return this.map(function () {
        return D.call(this.childNodes);
      });
    }, siblings: function siblings(a) {
      return q(this.map(function (a, b) {
        return E.call(o(b.parentNode), function (a) {
          return a !== b;
        });
      }), a);
    }, empty: function empty() {
      return this.each(function () {
        this.innerHTML = "";
      });
    }, pluck: function pluck(a) {
      return y.map(this, function (b) {
        return b[a];
      });
    }, show: function show() {
      return this.each(function () {
        "none" == this.style.display && (this.style.display = null), "none" == I(this, "").getPropertyValue("display") && (this.style.display = n(this.nodeName));
      });
    }, replaceWith: function replaceWith(a) {
      return this.before(a).remove();
    }, wrap: function wrap(a) {
      var c = b(a);if (this[0] && !c) var d = y(a).get(0),
          e = d.parentNode || this.length > 1;return this.each(function (b) {
        y(this).wrapAll(c ? a.call(this, b) : e ? d.cloneNode(!0) : d);
      });
    }, wrapAll: function wrapAll(a) {
      if (this[0]) {
        y(this[0]).before(a = y(a));for (var b; (b = a.children()).length;) {
          a = b.first();
        }y(a).append(this);
      }return this;
    }, wrapInner: function wrapInner(a) {
      var c = b(a);return this.each(function (b) {
        var d = y(this),
            e = d.contents(),
            f = c ? a.call(this, b) : a;e.length ? e.wrapAll(f) : d.append(f);
      });
    }, unwrap: function unwrap() {
      return this.parent().each(function () {
        y(this).replaceWith(y(this).children());
      }), this;
    }, clone: function clone() {
      return this.map(function () {
        return this.cloneNode(!0);
      });
    }, hide: function hide() {
      return this.css("display", "none");
    }, toggle: function toggle(a) {
      return this.each(function () {
        var b = y(this);(a === w ? "none" == b.css("display") : a) ? b.show() : b.hide();
      });
    }, prev: function prev(a) {
      return y(this.pluck("previousElementSibling")).filter(a || "*");
    }, next: function next(a) {
      return y(this.pluck("nextElementSibling")).filter(a || "*");
    }, html: function html(a) {
      return a === w ? this.length > 0 ? this[0].innerHTML : null : this.each(function (b) {
        var c = this.innerHTML;y(this).empty().append(r(this, a, b, c));
      });
    }, text: function text(a) {
      return a === w ? this.length > 0 ? this[0].textContent : null : this.each(function () {
        this.textContent = a;
      });
    }, attr: function attr(a, b) {
      var c;return "string" == typeof a && b === w ? 0 == this.length || 1 !== this[0].nodeType ? w : "value" == a && "INPUT" == this[0].nodeName ? this.val() : !(c = this[0].getAttribute(a)) && a in this[0] ? this[0][a] : c : this.each(function (c) {
        if (1 === this.nodeType) if (e(a)) for (x in a) {
          s(this, x, a[x]);
        } else s(this, a, r(this, b, c, this.getAttribute(a)));
      });
    }, removeAttr: function removeAttr(a) {
      return this.each(function () {
        1 === this.nodeType && s(this, a);
      });
    }, prop: function prop(a, b) {
      return b === w ? this[0] && this[0][a] : this.each(function (c) {
        this[a] = r(this, b, c, this[a]);
      });
    }, data: function data(a, b) {
      var c = this.attr("data-" + k(a), b);return null !== c ? u(c) : w;
    }, val: function val(a) {
      return a === w ? this[0] && (this[0].multiple ? y(this[0]).find("option").filter(function (a) {
        return this.selected;
      }).pluck("value") : this[0].value) : this.each(function (b) {
        this.value = r(this, a, b, this.value);
      });
    }, offset: function offset(a) {
      if (a) return this.each(function (b) {
        var c = y(this),
            d = r(this, a, b, c.offset()),
            e = c.offsetParent().offset(),
            f = { top: d.top - e.top, left: d.left - e.left };"static" == c.css("position") && (f.position = "relative"), c.css(f);
      });if (0 == this.length) return null;var b = this[0].getBoundingClientRect();return { left: b.left + window.pageXOffset, top: b.top + window.pageYOffset, width: Math.round(b.width), height: Math.round(b.height) };
    }, css: function css(b, c) {
      if (arguments.length < 2 && "string" == typeof b) return this[0] && (this[0].style[A(b)] || I(this[0], "").getPropertyValue(b));var d = "";if ("string" == a(b)) c || 0 === c ? d = k(b) + ":" + m(b, c) : this.each(function () {
        this.style.removeProperty(k(b));
      });else for (x in b) {
        b[x] || 0 === b[x] ? d += k(x) + ":" + m(x, b[x]) + ";" : this.each(function () {
          this.style.removeProperty(k(x));
        });
      }return this.each(function () {
        this.style.cssText += ";" + d;
      });
    }, index: function index(a) {
      return a ? this.indexOf(y(a)[0]) : this.parent().children().indexOf(this[0]);
    }, hasClass: function hasClass(a) {
      return C.some.call(this, function (a) {
        return this.test(t(a));
      }, l(a));
    }, addClass: function addClass(a) {
      return this.each(function (b) {
        z = [];var c = t(this),
            d = r(this, a, b, c);d.split(/\s+/g).forEach(function (a) {
          y(this).hasClass(a) || z.push(a);
        }, this), z.length && t(this, c + (c ? " " : "") + z.join(" "));
      });
    }, removeClass: function removeClass(a) {
      return this.each(function (b) {
        return a === w ? t(this, "") : (z = t(this), r(this, a, b, z).split(/\s+/g).forEach(function (a) {
          z = z.replace(l(a), " ");
        }), void t(this, z.trim()));
      });
    }, toggleClass: function toggleClass(a, b) {
      return this.each(function (c) {
        var d = y(this),
            e = r(this, a, c, t(this));e.split(/\s+/g).forEach(function (a) {
          (b === w ? !d.hasClass(a) : b) ? d.addClass(a) : d.removeClass(a);
        });
      });
    }, scrollTop: function scrollTop() {
      return this.length ? "scrollTop" in this[0] ? this[0].scrollTop : this[0].scrollY : void 0;
    }, position: function position() {
      if (this.length) {
        var a = this[0],
            b = this.offsetParent(),
            c = this.offset(),
            d = M.test(b[0].nodeName) ? { top: 0, left: 0 } : b.offset();return c.top -= parseFloat(y(a).css("margin-top")) || 0, c.left -= parseFloat(y(a).css("margin-left")) || 0, d.top += parseFloat(y(b[0]).css("border-top-width")) || 0, d.left += parseFloat(y(b[0]).css("border-left-width")) || 0, { top: c.top - d.top, left: c.left - d.left };
      }
    }, offsetParent: function offsetParent() {
      return this.map(function () {
        for (var a = this.offsetParent || F.body; a && !M.test(a.nodeName) && "static" == y(a).css("position");) {
          a = a.offsetParent;
        }return a;
      });
    } }, y.fn.detach = y.fn.remove, ["width", "height"].forEach(function (a) {
    y.fn[a] = function (b) {
      var e,
          f = this[0],
          g = a.replace(/./, function (a) {
        return a[0].toUpperCase();
      });return b === w ? c(f) ? f["inner" + g] : d(f) ? f.documentElement["offset" + g] : (e = this.offset()) && e[a] : this.each(function (c) {
        f = y(this), f.css(a, r(this, b, c, f[a]()));
      });
    };
  }), O.forEach(function (b, c) {
    var d = c % 2;y.fn[b] = function () {
      var b,
          e,
          f = y.map(arguments, function (c) {
        return b = a(c), "object" == b || "array" == b || null == c ? c : Y.fragment(c);
      }),
          g = this.length > 1;return f.length < 1 ? this : this.each(function (a, b) {
        e = d ? b : b.parentNode, b = 0 == c ? b.nextSibling : 1 == c ? b.firstChild : 2 == c ? b : null, f.forEach(function (a) {
          if (g) a = a.cloneNode(!0);else if (!e) return y(a).remove();v(e.insertBefore(a, b), function (a) {
            null == a.nodeName || "SCRIPT" !== a.nodeName.toUpperCase() || a.type && "text/javascript" !== a.type || a.src || window.eval.call(window, a.innerHTML);
          });
        });
      });
    }, y.fn[d ? b + "To" : "insert" + (c ? "Before" : "After")] = function (a) {
      return y(a)[b](this), this;
    };
  }), Y.Z.prototype = y.fn, Y.uniq = B, Y.deserializeValue = u, y.zepto = Y, y;
}();window.Zepto = Zepto, "$" in window || (window.$ = Zepto), function (a) {
  function b(a) {
    var b = this.os = {},
        c = this.browser = {},
        d = a.match(/WebKit\/([\d.]+)/),
        e = a.match(/(Android)\s+([\d.]+)/),
        f = a.match(/(iPad).*OS\s([\d_]+)/),
        g = !f && a.match(/(iPhone\sOS)\s([\d_]+)/),
        h = a.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
        i = h && a.match(/TouchPad/),
        j = a.match(/Kindle\/([\d.]+)/),
        k = a.match(/Silk\/([\d._]+)/),
        l = a.match(/(BlackBerry).*Version\/([\d.]+)/),
        m = a.match(/(BB10).*Version\/([\d.]+)/),
        n = a.match(/(RIM\sTablet\sOS)\s([\d.]+)/),
        o = a.match(/PlayBook/),
        p = a.match(/Chrome\/([\d.]+)/) || a.match(/CriOS\/([\d.]+)/),
        q = a.match(/Firefox\/([\d.]+)/);(c.webkit = !!d) && (c.version = d[1]), e && (b.android = !0, b.version = e[2]), g && (b.ios = b.iphone = !0, b.version = g[2].replace(/_/g, ".")), f && (b.ios = b.ipad = !0, b.version = f[2].replace(/_/g, ".")), h && (b.webos = !0, b.version = h[2]), i && (b.touchpad = !0), l && (b.blackberry = !0, b.version = l[2]), m && (b.bb10 = !0, b.version = m[2]), n && (b.rimtabletos = !0, b.version = n[2]), o && (c.playbook = !0), j && (b.kindle = !0, b.version = j[1]), k && (c.silk = !0, c.version = k[1]), !k && b.android && a.match(/Kindle Fire/) && (c.silk = !0), p && (c.chrome = !0, c.version = p[1]), q && (c.firefox = !0, c.version = q[1]), b.tablet = !!(f || o || e && !a.match(/Mobile/) || q && a.match(/Tablet/)), b.phone = !(b.tablet || !(e || g || h || l || m || p && a.match(/Android/) || p && a.match(/CriOS\/([\d.]+)/) || q && a.match(/Mobile/)));
  }b.call(a, navigator.userAgent), a.__detect = b;
}(Zepto), function (a) {
  function b(a) {
    return a._zid || (a._zid = n++);
  }function c(a, c, f, g) {
    if (c = d(c), c.ns) var h = e(c.ns);return (m[b(a)] || []).filter(function (a) {
      return a && (!c.e || a.e == c.e) && (!c.ns || h.test(a.ns)) && (!f || b(a.fn) === b(f)) && (!g || a.sel == g);
    });
  }function d(a) {
    var b = ("" + a).split(".");return { e: b[0], ns: b.slice(1).sort().join(" ") };
  }function e(a) {
    return new RegExp("(?:^| )" + a.replace(" ", " .* ?") + "(?: |$)");
  }function f(b, c, d) {
    "string" != a.type(b) ? a.each(b, d) : b.split(/\s/).forEach(function (a) {
      d(a, c);
    });
  }function g(a, b) {
    return a.del && ("focus" == a.e || "blur" == a.e) || !!b;
  }function h(a) {
    return p[a] || a;
  }function i(c, e, i, j, k, l) {
    var n = b(c),
        o = m[n] || (m[n] = []);f(e, i, function (b, e) {
      var f = d(b);f.fn = e, f.sel = j, f.e in p && (e = function e(b) {
        var c = b.relatedTarget;return !c || c !== this && !a.contains(this, c) ? f.fn.apply(this, arguments) : void 0;
      }), f.del = k && k(e, b);var i = f.del || e;f.proxy = function (a) {
        var b = i.apply(c, [a].concat(a.data));return b === !1 && (a.preventDefault(), a.stopPropagation()), b;
      }, f.i = o.length, o.push(f), c.addEventListener(h(f.e), f.proxy, g(f, l));
    });
  }function j(a, d, e, i, j) {
    var k = b(a);f(d || "", e, function (b, d) {
      c(a, b, d, i).forEach(function (b) {
        delete m[k][b.i], a.removeEventListener(h(b.e), b.proxy, g(b, j));
      });
    });
  }function k(b) {
    var c,
        d = { originalEvent: b };for (c in b) {
      s.test(c) || void 0 === b[c] || (d[c] = b[c]);
    }return a.each(t, function (a, c) {
      d[a] = function () {
        return this[c] = q, b[a].apply(b, arguments);
      }, d[c] = r;
    }), d;
  }function l(a) {
    if (!("defaultPrevented" in a)) {
      a.defaultPrevented = !1;var b = a.preventDefault;a.preventDefault = function () {
        this.defaultPrevented = !0, b.call(this);
      };
    }
  }var m = (a.zepto.qsa, {}),
      n = 1,
      o = {},
      p = { mouseenter: "mouseover", mouseleave: "mouseout" };o.click = o.mousedown = o.mouseup = o.mousemove = "MouseEvents", a.event = { add: i, remove: j }, a.proxy = function (c, d) {
    if (a.isFunction(c)) {
      var e = function e() {
        return c.apply(d, arguments);
      };return e._zid = b(c), e;
    }if ("string" == typeof d) return a.proxy(c[d], c);throw new TypeError("expected function");
  }, a.fn.bind = function (a, b) {
    return this.each(function () {
      i(this, a, b);
    });
  }, a.fn.unbind = function (a, b) {
    return this.each(function () {
      j(this, a, b);
    });
  }, a.fn.one = function (a, b) {
    return this.each(function (c, d) {
      i(this, a, b, null, function (a, b) {
        return function () {
          var c = a.apply(d, arguments);return j(d, b, a), c;
        };
      });
    });
  };var q = function q() {
    return !0;
  },
      r = function r() {
    return !1;
  },
      s = /^([A-Z]|layer[XY]$)/,
      t = { preventDefault: "isDefaultPrevented", stopImmediatePropagation: "isImmediatePropagationStopped", stopPropagation: "isPropagationStopped" };a.fn.delegate = function (b, c, d) {
    return this.each(function (e, f) {
      i(f, c, d, b, function (c) {
        return function (d) {
          var e,
              g = a(d.target).closest(b, f).get(0);return g ? (e = a.extend(k(d), { currentTarget: g, liveFired: f }), c.apply(g, [e].concat([].slice.call(arguments, 1)))) : void 0;
        };
      });
    });
  }, a.fn.undelegate = function (a, b, c) {
    return this.each(function () {
      j(this, b, c, a);
    });
  }, a.fn.live = function (b, c) {
    return a(document.body).delegate(this.selector, b, c), this;
  }, a.fn.die = function (b, c) {
    return a(document.body).undelegate(this.selector, b, c), this;
  }, a.fn.on = function (b, c, d) {
    return !c || a.isFunction(c) ? this.bind(b, c || d) : this.delegate(c, b, d);
  }, a.fn.off = function (b, c, d) {
    return !c || a.isFunction(c) ? this.unbind(b, c || d) : this.undelegate(c, b, d);
  }, a.fn.trigger = function (b, c) {
    return ("string" == typeof b || a.isPlainObject(b)) && (b = a.Event(b)), l(b), b.data = c, this.each(function () {
      "dispatchEvent" in this && this.dispatchEvent(b);
    });
  }, a.fn.triggerHandler = function (b, d) {
    var e, f;return this.each(function (g, h) {
      e = k("string" == typeof b ? a.Event(b) : b), e.data = d, e.target = h, a.each(c(h, b.type || b), function (a, b) {
        return f = b.proxy(e), e.isImmediatePropagationStopped() ? !1 : void 0;
      });
    }), f;
  }, "focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function (b) {
    a.fn[b] = function (a) {
      return a ? this.bind(b, a) : this.trigger(b);
    };
  }), ["focus", "blur"].forEach(function (b) {
    a.fn[b] = function (a) {
      return a ? this.bind(b, a) : this.each(function () {
        try {
          this[b]();
        } catch (a) {}
      }), this;
    };
  }), a.Event = function (a, b) {
    "string" != typeof a && (b = a, a = b.type);var c = document.createEvent(o[a] || "Events"),
        d = !0;if (b) for (var e in b) {
      "bubbles" == e ? d = !!b[e] : c[e] = b[e];
    }return c.initEvent(a, d, !0, null, null, null, null, null, null, null, null, null, null, null, null), c.isDefaultPrevented = function () {
      return this.defaultPrevented;
    }, c;
  };
}(Zepto), function (a) {
  function b(b, c, d) {
    var e = a.Event(c);return a(b).trigger(e, d), !e.defaultPrevented;
  }function c(a, c, d, e) {
    return a.global ? b(c || s, d, e) : void 0;
  }function d(b) {
    b.global && 0 === a.active++ && c(b, null, "ajaxStart");
  }function e(b) {
    b.global && ! --a.active && c(b, null, "ajaxStop");
  }function f(a, b) {
    var d = b.context;return b.beforeSend.call(d, a, b) === !1 || c(b, d, "ajaxBeforeSend", [a, b]) === !1 ? !1 : void c(b, d, "ajaxSend", [a, b]);
  }function g(a, b, d) {
    var e = d.context,
        f = "success";d.success.call(e, a, f, b), c(d, e, "ajaxSuccess", [b, d, a]), i(f, b, d);
  }function h(a, b, d, e) {
    var f = e.context;e.error.call(f, d, b, a), c(e, f, "ajaxError", [d, e, a]), i(b, d, e);
  }function i(a, b, d) {
    var f = d.context;d.complete.call(f, b, a), c(d, f, "ajaxComplete", [b, d]), e(d);
  }function j() {}function k(a) {
    return a && (a = a.split(";", 2)[0]), a && (a == x ? "html" : a == w ? "json" : u.test(a) ? "script" : v.test(a) && "xml") || "text";
  }function l(a, b) {
    return (a + "&" + b).replace(/[&?]{1,2}/, "?");
  }function m(b) {
    b.processData && b.data && "string" != a.type(b.data) && (b.data = a.param(b.data, b.traditional)), !b.data || b.type && "GET" != b.type.toUpperCase() || (b.url = l(b.url, b.data));
  }function n(b, c, d, e) {
    var f = !a.isFunction(c);return { url: b, data: f ? c : void 0, success: f ? a.isFunction(d) ? d : void 0 : c, dataType: f ? e || d : d };
  }function o(b, c, d, e) {
    var f,
        g = a.isArray(c);a.each(c, function (c, h) {
      f = a.type(h), e && (c = d ? e : e + "[" + (g ? "" : c) + "]"), !e && g ? b.add(h.name, h.value) : "array" == f || !d && "object" == f ? o(b, h, d, c) : b.add(c, h);
    });
  }var p,
      q,
      r = 0,
      s = window.document,
      t = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
      u = /^(?:text|application)\/javascript/i,
      v = /^(?:text|application)\/xml/i,
      w = "application/json",
      x = "text/html",
      y = /^\s*$/;a.active = 0, a.ajaxJSONP = function (b) {
    if (!("type" in b)) return a.ajax(b);var c,
        d = "jsonp" + ++r,
        e = s.createElement("script"),
        i = function i() {
      clearTimeout(c), a(e).remove(), delete window[d];
    },
        k = function k(a) {
      i(), a && "timeout" != a || (window[d] = j), h(null, a || "abort", l, b);
    },
        l = { abort: k };return f(l, b) === !1 ? (k("abort"), !1) : (window[d] = function (a) {
      i(), g(a, l, b);
    }, e.onerror = function () {
      k("error");
    }, e.src = b.url.replace(/=\?/, "=" + d), a("head").append(e), b.timeout > 0 && (c = setTimeout(function () {
      k("timeout");
    }, b.timeout)), l);
  }, a.ajaxSettings = { type: "GET", beforeSend: j, success: j, error: j, complete: j, context: null, global: !0, xhr: function xhr() {
      return new window.XMLHttpRequest();
    }, accepts: { script: "text/javascript, application/javascript", json: w, xml: "application/xml, text/xml", html: x, text: "text/plain" }, crossDomain: !1, timeout: 0, processData: !0, cache: !0 }, a.ajax = function (b) {
    var c = a.extend({}, b || {});for (p in a.ajaxSettings) {
      void 0 === c[p] && (c[p] = a.ajaxSettings[p]);
    }d(c), c.crossDomain || (c.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(c.url) && RegExp.$2 != window.location.host), c.url || (c.url = window.location.toString()), m(c), c.cache === !1 && (c.url = l(c.url, "_=" + Date.now()));var e = c.dataType,
        i = /=\?/.test(c.url);if ("jsonp" == e || i) return i || (c.url = l(c.url, "callback=?")), a.ajaxJSONP(c);var n,
        o = c.accepts[e],
        r = {},
        s = /^([\w-]+:)\/\//.test(c.url) ? RegExp.$1 : window.location.protocol,
        t = c.xhr();c.crossDomain || (r["X-Requested-With"] = "XMLHttpRequest"), o && (r.Accept = o, o.indexOf(",") > -1 && (o = o.split(",", 2)[0]), t.overrideMimeType && t.overrideMimeType(o)), (c.contentType || c.contentType !== !1 && c.data && "GET" != c.type.toUpperCase()) && (r["Content-Type"] = c.contentType || "application/x-www-form-urlencoded"), c.headers = a.extend(r, c.headers || {}), t.onreadystatechange = function () {
      if (4 == t.readyState) {
        t.onreadystatechange = j, clearTimeout(n);var b,
            d = !1;if (t.status >= 200 && t.status < 300 || 304 == t.status || 0 == t.status && "file:" == s) {
          e = e || k(t.getResponseHeader("content-type")), b = t.responseText;try {
            "script" == e ? (1, eval)(b) : "xml" == e ? b = t.responseXML : "json" == e && (b = y.test(b) ? null : a.parseJSON(b));
          } catch (f) {
            d = f;
          }d ? h(d, "parsererror", t, c) : g(b, t, c);
        } else h(null, t.status ? "error" : "abort", t, c);
      }
    };var u = "async" in c ? c.async : !0;t.open(c.type, c.url, u);for (q in c.headers) {
      t.setRequestHeader(q, c.headers[q]);
    }return f(t, c) === !1 ? (t.abort(), !1) : (c.timeout > 0 && (n = setTimeout(function () {
      t.onreadystatechange = j, t.abort(), h(null, "timeout", t, c);
    }, c.timeout)), t.send(c.data ? c.data : null), t);
  }, a.get = function (b, c, d, e) {
    return a.ajax(n.apply(null, arguments));
  }, a.post = function (b, c, d, e) {
    var f = n.apply(null, arguments);return f.type = "POST", a.ajax(f);
  }, a.getJSON = function (b, c, d) {
    var e = n.apply(null, arguments);return e.dataType = "json", a.ajax(e);
  }, a.fn.load = function (b, c, d) {
    if (!this.length) return this;var e,
        f = this,
        g = b.split(/\s/),
        h = n(b, c, d),
        i = h.success;return g.length > 1 && (h.url = g[0], e = g[1]), h.success = function (b) {
      f.html(e ? a("<div>").html(b.replace(t, "")).find(e) : b), i && i.apply(f, arguments);
    }, a.ajax(h), this;
  };var z = encodeURIComponent;a.param = function (a, b) {
    var c = [];return c.add = function (a, b) {
      this.push(z(a) + "=" + z(b));
    }, o(c, a, b), c.join("&").replace(/%20/g, "+");
  };
}(Zepto), function (a) {
  a.fn.serializeArray = function () {
    var b,
        c = [];return a(Array.prototype.slice.call(this.get(0).elements)).each(function () {
      b = a(this);var d = b.attr("type");"fieldset" != this.nodeName.toLowerCase() && !this.disabled && "submit" != d && "reset" != d && "button" != d && ("radio" != d && "checkbox" != d || this.checked) && c.push({ name: b.attr("name"), value: b.val() });
    }), c;
  }, a.fn.serialize = function () {
    var a = [];return this.serializeArray().forEach(function (b) {
      a.push(encodeURIComponent(b.name) + "=" + encodeURIComponent(b.value));
    }), a.join("&");
  }, a.fn.submit = function (b) {
    if (b) this.bind("submit", b);else if (this.length) {
      var c = a.Event("submit");this.eq(0).trigger(c), c.defaultPrevented || this.get(0).submit();
    }return this;
  };
}(Zepto), function (a, b) {
  function c(a) {
    return d(a.replace(/([a-z])([A-Z])/, "$1-$2"));
  }function d(a) {
    return a.toLowerCase();
  }function e(a) {
    return f ? f + a : d(a);
  }var f,
      g,
      h,
      i,
      j,
      k,
      l,
      m,
      n = "",
      o = { Webkit: "webkit", Moz: "", O: "o", ms: "MS" },
      p = window.document,
      q = p.createElement("div"),
      r = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,
      s = {};a.each(o, function (a, c) {
    return q.style[a + "TransitionProperty"] !== b ? (n = "-" + d(a) + "-", f = c, !1) : void 0;
  }), g = n + "transform", s[h = n + "transition-property"] = s[i = n + "transition-duration"] = s[j = n + "transition-timing-function"] = s[k = n + "animation-name"] = s[l = n + "animation-duration"] = s[m = n + "animation-timing-function"] = "", a.fx = { off: f === b && q.style.transitionProperty === b, speeds: { _default: 400, fast: 200, slow: 600 }, cssPrefix: n, transitionEnd: e("TransitionEnd"), animationEnd: e("AnimationEnd") }, a.fn.animate = function (b, c, d, e) {
    return a.isPlainObject(c) && (d = c.easing, e = c.complete, c = c.duration), c && (c = ("number" == typeof c ? c : a.fx.speeds[c] || a.fx.speeds._default) / 1e3), this.anim(b, c, d, e);
  }, a.fn.anim = function (d, e, f, n) {
    var o,
        p,
        _q,
        t = {},
        u = "",
        v = this,
        w = a.fx.transitionEnd;if (e === b && (e = .4), a.fx.off && (e = 0), "string" == typeof d) t[k] = d, t[l] = e + "s", t[m] = f || "linear", w = a.fx.animationEnd;else {
      p = [];for (o in d) {
        r.test(o) ? u += o + "(" + d[o] + ") " : (t[o] = d[o], p.push(c(o)));
      }u && (t[g] = u, p.push(g)), e > 0 && "object" == (typeof d === "undefined" ? "undefined" : _typeof(d)) && (t[h] = p.join(", "), t[i] = e + "s", t[j] = f || "linear");
    }return _q = function q(b) {
      if ("undefined" != typeof b) {
        if (b.target !== b.currentTarget) return;a(b.target).unbind(w, _q);
      }a(this).css(s), n && n.call(this);
    }, e > 0 && this.bind(w, _q), this.size() && this.get(0).clientLeft, this.css(t), 0 >= e && setTimeout(function () {
      v.each(function () {
        _q.call(this);
      });
    }, 0), this;
  }, q = null;
}(Zepto);
;(function ($, undefined) {
  var document = window.document,
      origShow = $.fn.show,
      origHide = $.fn.hide,
      origToggle = $.fn.toggle;

  function anim(el, speed, opacity, scale, callback) {
    if (typeof speed == 'function' && !callback) callback = speed, speed = undefined;
    var props = { opacity: opacity };
    if (scale) {
      props.scale = scale;
      el.css($.fx.cssPrefix + 'transform-origin', '0 0');
    }
    return el.animate(props, speed, null, callback);
  }

  function hide(el, speed, scale, callback) {
    return anim(el, speed, 0, scale, function () {
      origHide.call($(this));
      callback && callback.call(this);
    });
  }

  $.fn.show = function (speed, callback) {
    origShow.call(this);
    if (speed === undefined) speed = 0;else this.css('opacity', 0);
    return anim(this, speed, 1, '1,1', callback);
  };

  $.fn.hide = function (speed, callback) {
    if (speed === undefined) return origHide.call(this);else return hide(this, speed, '0,0', callback);
  };

  $.fn.toggle = function (speed, callback) {
    if (speed === undefined || typeof speed == 'boolean') return origToggle.call(this, speed);else return this.each(function () {
      var el = $(this);
      el[el.css('display') == 'none' ? 'show' : 'hide'](speed, callback);
    });
  };

  $.fn.fadeTo = function (speed, opacity, callback) {
    return anim(this, speed, opacity, null, callback);
  };

  $.fn.fadeIn = function (speed, callback) {
    var target = this.css('opacity');
    if (target > 0) this.css('opacity', 0);else target = 1;
    return origShow.call(this).fadeTo(speed, target, callback);
  };

  $.fn.fadeOut = function (speed, callback) {
    return hide(this, speed, null, callback);
  };

  $.fn.fadeToggle = function (speed, callback) {
    return this.each(function () {
      var el = $(this);
      el[el.css('opacity') == 0 || el.css('display') == 'none' ? 'fadeIn' : 'fadeOut'](speed, callback);
    });
  };

  $.toastAlert = function (Msg, status) {
    if (status === 1) {
      $('#alertBox').removeClass('wrong-input').addClass('success-toast');
    } else {
      $('#alertBox').removeClass('success-toast').addClass('wrong-input');
    }
    $('#alertBox').text(Msg).fadeIn();

    setTimeout(function () {
      $('#alertBox').fadeOut();
    }, 3000);
  };

  $.fn.outerWidth = function (margin) {
    var elem = this;
    if (elem) {
      var size = elem.height();
      if (margin) {
        size += parseFloat(elem.css('margin-left'));
        size += parseFloat(elem.css('margin-right'));
      }
      return size;
    } else {
      return null;
    }
  };

  $.fn.outerHeight = function (margin) {
    var elem = this;
    if (elem) {
      var size = elem.height();
      if (margin) {
        size += parseFloat(elem.css('margin-top'));
        size += parseFloat(elem.css('margin-bottom'));
      }
      return size;
    } else {
      return null;
    }
  };
})(window.Zepto);
var config = {
  APPID: 'wx27900e3078720b6f',
  socialType: 'wx-jqfx',
  apiUrl: 'https://gate.97kid.com',
  staticUrl: 'https://gstatic.97kid.com',
  requestTimeout: 20000,
  appId: 'antYy9lOFi5mkU9QKjtYmRLM-gzGzoHsz',
  appKey: 'jqyWxLyobpsmdwsJddJlDheb'
};

var utils = function ($) {
  return {
    noop: function noop() {},
    setBackUrl: function setBackUrl(url) {
      window.history.pushState(null, '', window.location.href);
      window.addEventListener('popstate', function () {
        window.location.href = url;
      }, false);
    },
    isEmpty: function isEmpty(obj) {
      if (obj === null) return true;
      var type = Object.prototype.toString.call(obj);
      if (type === '[object Array]' || type === '[object String]') {
        return obj.length === 0;
      }
      if (type === '[object Number]') {
        return obj === 0;
      }
      for (var name in obj) {
        return false;
      }
      return true;
    },
    getQueryString: function getQueryString(name) {
      var r1 = getMatched(name, window.location.search);
      if (r1) return r1;
      var key = arguments[1];
      if (key) {
        return getMatched(name, window.localStorage.getItem(key));
      }
      return null;

      function getMatched(name, string) {
        if (string) {
          var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
          var len = string.indexOf('?') == 0 ? 1 : 0;
          var r = string.substr(len).match(reg);
          if (r != null) return unescape(r[2]);
        }
        return null;
      }
    },
    isWeChat: function isWeChat() {
      return (/(MicroMessenger)/i.test(navigator.userAgent)
      );
    },
    isIOS: function isIOS() {
      return (/iPad|iPhone|iPod/.test(navigator.platform)
      );
    },
    isIosWebView: function isIosWebView() {
      return (/iPad|iPhone|iPod/.test(navigator.platform) && navigator.userAgent.indexOf('Safari') === -1
      );
    },
    isAndroid: function isAndroid() {
      return (/(android)/i.test(navigator.userAgent)
      );
    },
    isAndroidWebView: function isAndroidWebView() {
      return (/(android)/i.test(navigator.userAgent) && (typeof android === "undefined" ? "undefined" : _typeof(android)) === 'object'
      );
    },
    isWebView: function isWebView() {
      return utils.isIosWebView() || utils.isAndroidWebView();
    },
    isMobile: function isMobile() {
      return utils.isIOS() || utils.isAndroid();
    },
    parseUrlParam: function parseUrlParam(key) {
      var match,
          pl = /\+/g,
          // Regex for replacing addition symbol with a space
      search = /([^&=]+)=?([^&]*)/g,
          decode = function decode(s) {
        return decodeURIComponent(s.replace(pl, ' '));
      },
          query = window.location.search.substring(1),
          params = {};
      while (match = search.exec(query)) {
        params[decode(match[1])] = decode(match[2]);
      }return key ? params[key] : params;
    },
    parseUrlHash: function parseUrlHash(key) {
      var match,
          pl = /\+/g,
          // Regex for replacing addition symbol with a space
      search = /([^&=]+)=?([^&]*)/g,
          decode = function decode(s) {
        return decodeURIComponent(s.replace(pl, ' '));
      },
          query = window.location.hash.substring(1),
          params = {};
      while (match = search.exec(query)) {
        params[decode(match[1])] = decode(match[2]);
      }return key ? params[key] : params;
    },
    saveUrlParam: function saveUrlParam() {
      var param = utils.getUrlParam();
      try {
        if (param) {
          var state = Math.random().toString().slice(-6);
          delete param.state;
          delete param.code;
          window.localStorage.setItem('param_' + state, JSON.stringify(param));
          console.log('save url param: ', param);
          return '&state=' + state;
        }
      } catch (e) {}
      return '';
    },
    recoverUrlParam: function recoverUrlParam() {
      var state = utils.getUrlParam('state');
      try {
        var param = JSON.parse(window.localStorage.getItem('param_' + state));
        delete param.state;
        delete param.code;
        utils.setUrlParam(param);
        window.localStorage.removeItem('param_' + state);
        return param;
      } catch (e) {}
    },
    getUrlParam: function getUrlParam(key) {
      return utils.parseUrlParam(key);
    },
    getUrlHash: function getUrlHash(key) {
      return utils.parseUrlHash(key);
    },
    getUrlParamWithState: function getUrlParamWithState(key) {
      if (utils.parseUrlParam(key)) return utils.parseUrlParam(key);else if (utils.parseUrlParam('state')) {
        try {
          return JSON.parse(utils.base64ToUtf8(utils.getUrlParam('state')))[key];
        } catch (e) {
          return '';
        }
      }
      return '';
    },
    toUrlParam: function toUrlParam(obj) {
      var arr = [];
      for (var key in obj) {
        arr.push(key + '=' + encodeURIComponent(obj[key]));
      }
      return arr.join('&');
    },
    toUrlHash: function toUrlHash(obj) {
      var arr = [];
      for (var key in obj) {
        arr.push(key + '=' + encodeURIComponent(obj[key]));
      }
      return arr.join('&');
    },
    /**
     * 删除指定url参数
     * @param key
     */
    deleteUrlParam: function deleteUrlParam(key) {
      var params = utils.getUrlParam();
      if (params[key]) {
        delete params[key];
        window.history.pushState(null, null, location.pathname + '?' + utils.toUrlParam(params));
      }
    },
    /**
     * 更新url参数
     * @param key
     */
    updateUrlParam: function updateUrlParam(obj) {
      for (var key in obj) {
        utils.deleteUrlParam(key);
      }window.history.pushState(null, null, location.href + (/\?/.test(location.href) ? '&' : '?') + utils.toUrlParam(obj));
    },
    /**
     * 设置url参数
     * @param key
     */
    setUrlParam: function setUrlParam(obj) {
      var params = utils.getUrlParam();
      for (var key in obj) {
        if (params[key]) {
          var t = {};
          t[key] = obj[key];
          utils.updateUrlParam(t);
        } else {
          var t = {};
          t[key] = obj[key];
          window.history.pushState(null, null, location.href + (/\?/.test(location.href) ? '&' : '?') + utils.toUrlParam(t));
        }
      }
    },
    format: function format(x, y) {
      var z = {
        y: x.getFullYear(),
        M: x.getMonth() + 1,
        d: x.getDate(),
        h: x.getHours(),
        m: x.getMinutes(),
        s: x.getSeconds()
      };
      return y.replace(/(y+|M+|d+|h+|m+|s+)/g, function (v) {
        return ((v.length > 1 ? '0' : '') + eval('z.' + v.slice(-1))).slice(-(v.length > 2 ? v.length : 2));
      });
    },
    showLoading: function showLoading(text) {
      if (document.getElementById('weui-loading_toast')) return;
      var dvMsg = document.createElement('div');
      dvMsg.className = 'weui-loading_toast';
      dvMsg.setAttribute('id', 'weui-loading_toast');
      dvMsg.innerHTML = '<div class="weui-mask_transparent"></div>' + '<div class="weui-toast">' + '    <i class="weui-loading"></i>' + '    <p class="weui-toast__content">' + (text || '正在加载') + '</p>' + '</div>' + '<style>' + '.weui-loading_toast .weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-loading_toast .weui-toast{position:fixed;z-index:5000;width:32vw;min-height:32vw;top:48vw;left:50%;margin-left:-16vw;background:hsla(0,0%,7%,.7);text-align:center;border-radius:1.333vw;color:#fff;content:"viewport-units-buggyfill; width: 32vw; min-height: 32vw; top: 48vw; margin-left: -16vw; border-radius: 1.333vw"}.weui-loading_toast .weui-toast .weui-loading{margin:5.867vw auto 2.667vw;width:10.133vw;height:10.133vw;vertical-align:baseline;display:inline-block;-webkit-animation:loading-rotate 1s steps(12) infinite;animation:loading-rotate 1s steps(12) infinite;background:transparent url() no-repeat;background-size:100%;content:"viewport-units-buggyfill; margin: 5.867vw auto 2.667vw auto; width: 10.133vw; height: 10.133vw"}@-webkit-keyframes loading-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-loading_toast .weui-toast .weui-toast__content{margin:0 0 4vw;content:"viewport-units-buggyfill; margin: 0 0 4vw"}' + '</style>';
      document.body.appendChild(dvMsg);
    },
    hideLoading: function hideLoading() {
      document.getElementById('weui-loading_toast') && document.getElementById('weui-loading_toast').parentNode.removeChild(document.getElementById('weui-loading_toast'));
    },
    alert: function alert(options, yesText) {
      if (typeof options === 'string') {
        // 兼容直接传字符串作为参数的写法
        options = {
          id: Math.ceil(Math.random() * 1000000000),
          message: options,
          yesText: typeof yesText === 'string' ? yesText : '好的',
          yes: utils.noop,
          mask: true
        };
      } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === 'object') {
        options.id = options.id || Math.ceil(Math.random() * 1000000000);
        options.message = options.message || '确定要这么做吗?';
        options.yesText = options.yesText || '好的';
        options.yes = options.yes || function () {};
        options.mask = !options.mask;
      } else return;

      // 创建提示对话框面板
      var alertMask = document.createElement('div');
      alertMask.setAttribute('id', 'alert-mask-' + options.id);
      alertMask.className = 'alert-mask hidden';
      if (!options.mask) alertMask.style.background = 'transparent';
      alertMask.innerHTML = '<div id="alert-box-' + options.id + '" class="alert hidden">' + '  <div class="title">' + options.message + '</div>' + '  <div id="alert-ok-' + options.id + '" class="button">' + options.yesText + '</div>' + '</div>' + '<style>' + '.alert-mask{position:fixed;top:0;width:100%;height:100%;background:rgba(0,0,0,.8);z-index:1005;overflow:hidden;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .25s linear 0s;transition:opacity .25s linear 0s}.alert-mask .alert{width:78.667vw;background:#fff;border-radius:2.133vw;text-align:center;-webkit-transition:-webkit-transform .25s linear 0s;transition:-webkit-transform .25s linear 0s;transition:transform .25s linear 0s;transition:transform .25s linear 0s,-webkit-transform .25s linear 0s;content:"viewport-units-buggyfill; width: 78.667vw; border-radius: 2.133vw"}.alert-mask .alert .title{padding:0 5.333vw;min-height:25.6vw;font-size:4.267vw;font-family:VarelaRound-Regular;color:#676c75;line-height:6.4vw;border-bottom:.267vw solid #e7e8ea;content:"viewport-units-buggyfill; padding: 0 5.333vw; min-height: 25.6vw; font-size: 4.267vw; line-height: 6.4vw; border-bottom: 0.267vw solid #e7e8ea"}.alert-mask .alert .button,.alert-mask .alert .title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.alert-mask .alert .button{min-height:15.2vw;font-size:4.8vw;font-family:PingFangSC-Medium;color:#32cdff;line-height:6.667vw;content:"viewport-units-buggyfill; min-height: 15.2vw; font-size: 4.8vw; line-height: 6.667vw"}.alert-mask .alert.show{-webkit-transform:scale(1);transform:scale(1)}.alert-mask .alert.hidden{-webkit-transform:scale(0);transform:scale(0)}.alert-mask.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.alert-mask.hidden{display:none;opacity:0}' + '</style>';

      add();

      // 绑定点击事件
      document.getElementById('alert-ok-' + options.id).addEventListener('click', remove, false);

      function add() {
        document.body.appendChild(alertMask);
        document.body.style.overflow = 'hidden';
        alertMask.className = 'alert-mask show';
        setTimeout(function () {
          document.getElementById('alert-box-' + options.id).className = 'alert show';
        }, 0);
      }

      function remove() {
        document.getElementById('alert-box-' + options.id).className = 'alert hidden';
        setTimeout(function () {
          alertMask.className = 'alert-mask hidden';
          document.body.style.overflow = 'auto';
          document.body.removeChild(document.getElementById('alert-mask-' + options.id));
          options.yes(true);
        }, 250);
      }
    },
    utf8ToBase64: function utf8ToBase64(str) {
      return btoa(unescape(encodeURIComponent(str)));
    },
    base64ToUtf8: function base64ToUtf8(str) {
      return decodeURIComponent(escape(atob(str)));
    },
    toast: function toast(options) {
      if (typeof options === 'string') {
        // 兼容直接传字符串作为参数的写法
        options = {
          message: options
        };
      } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === 'object') {
        options.message = options.message || '';
      } else return;

      options.id = options.id || Math.ceil(Math.random() * 1000000000);
      options.timer = options.timer || 3000;
      options.callback = options.callback || utils.noop;
      options.mask = options.mask === undefined ? true : Boolean(options.mask);

      // 创建提示对话框面板
      var toastMask = document.createElement('div');
      toastMask.setAttribute('id', 'toast-mask-' + options.id);
      toastMask.className = 'toast-mask hidden';
      if (!options.mask) toastMask.style.background = 'transparent';
      toastMask.innerHTML = '<div id="toast-box-' + options.id + '" class="toast hidden">' + options.message + '</div>' + '<style>' + '.toast-mask{position:fixed;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;z-index:1004}.toast-mask .toast{min-width:45.333vw;max-width:48.667vw;padding:4vw;line-height:5.333vw;color:#fff;background-color:rgba(0,0,0,.5);border-radius:1.333vw;font-size:3.733vw;text-align:center;display:block;z-index:1009;content:"viewport-units-buggyfill; min-width: 45.333vw; max-width: 48.667vw; padding: 4vw; line-height: 5.333vw; border-radius: 1.333vw; font-size: 3.733vw"}.toast-mask .toast.show{-webkit-transform:scale(1);transform:scale(1)}.toast-mask .toast.hidden{-webkit-transform:scale(0);transform:scale(0)}.toast-mask.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.toast-mask.hidden{display:none;opacity:0}' + '</style>';

      add();
      setTimeout(remove, options.timer);

      function add() {
        document.body.appendChild(toastMask);
        document.body.style.overflow = 'hidden';
        toastMask.className = 'toast-mask show';
        setTimeout(function () {
          document.getElementById('toast-box-' + options.id).className = 'toast show';
        }, 0);
      }

      function remove() {
        document.getElementById('toast-box-' + options.id).className = 'toast hidden';
        setTimeout(function () {
          toastMask.className = 'toast-mask hidden';
          document.body.style.overflow = 'auto';
          document.body.removeChild(document.getElementById('toast-mask-' + options.id));
          options.callback(true);
        }, 250);
      }
    }
  };
}(window.Zepto);(function ($) {
  var config = {
    APPID: 'wx27900e3078720b6f',
    socialType: 'wx-jqfx',
    apiUrl: 'https://gate.97kid.com',
    staticUrl: 'https://gstatic.97kid.com',
    requestTimeout: 20000,
    appId: 'antYy9lOFi5mkU9QKjtYmRLM-gzGzoHsz',
    appKey: 'jqyWxLyobpsmdwsJddJlDheb'
  };
  $.toastAlert = function (Msg, status) {
    if (Msg === '社交账号不存在') return;
    if (Msg === '未登录') return;
    var $box = $('#alertBox');
    if (!$box.length) {
      $('body').append('<div id="alertBox" class="alert-box"></div>');
      $box = $('#alertBox');
    }
    if (status === 2) {
      $box.removeClass('success-toast').addClass('wrong-input');
    } else {
      $box.removeClass('wrong-input').addClass('success-toast');
    }
    $box.html(Msg);
    $box.fadeIn();

    setTimeout(function () {
      $box.fadeOut();
    }, 3000);
  };

  function Account(options) {
    this.options = $.extend({
      returnUrl: window.location.origin + window.location.pathname,
      showRegister: true,
      forceLogin: true
    }, options);
    this.accessKey = 'QKidsAccess';
    this.weChatCodeKey = 'QKidsCode';
    this.weChatCodeTimeKey = 'QKidsCodeTime';
    this.pathnameKey = 'QKidsPathname';
    this.userInfoKey = 'QKidsUserInfo';
    this.referenceKey = 'QKidsReference';
    this.channleKey = 'QKidsChannel';
    this.authCallbackKey = 'QKidsCallback';
    this.openId = 'QKidsOpenId';
    this.token = '';
    this.returnUrl = this.options.returnUrl;
    this.showRegister = this.options.showRegister;
    this.code = '';
    this.forceLogin = this.options.forceLogin;
    this.socialBinded = true;
    this.accountLoading = false;
    this.closeBtn = this.options.closeBtn !== false;

    var weChatCodeTime = window.localStorage.getItem(this.weChatCodeTimeKey);
    if (weChatCodeTime && weChatCodeTime < new Date().getTime()) {
      this.code = window.localStorage.getItem(this.weChatCodeKey);
    }

    var weChatInfo = navigator.userAgent.match(/MicroMessenger\/([\d\.]+)/i);
    this.inWeChat = !utils.isEmpty(weChatInfo);

    if (this.inWeChat && !utils.getQueryString('code')) {
      window.localStorage.setItem(this.pathnameKey, window.location.search);
    }

    if (utils.getQueryString('_r')) {
      window.localStorage.setItem(this.referenceKey, JSON.stringify({
        rawData: utils.getQueryString('_r'),
        expires: new Date().getTime() / 1000 + 24 * 3600
      }));
    }
    if (utils.getQueryString('_c')) {
      window.localStorage.setItem(this.channleKey, JSON.stringify({
        rawData: utils.getQueryString('_c'),
        expires: new Date().getTime() / 1000 + 24 * 3600
      }));
    }
  }

  // 登录
  Account.prototype.login = function (callback) {
    var self = this;
    self.checkLoginStatus(function (err, authObj) {
      if (err) {
        callback(err);
        self._showLogin(callback);
      } else {
        callback(err, authObj);
      }
    });
  };

  // 获取用户信息
  Account.prototype.getUserInfo = function (callback) {
    var self = this;
    self.checkLoginStatus(function (err) {
      if (err) {
        if (self.forceLogin) {
          self.login(function (err) {
            if (err) callback(err);else self._getUserInfo(callback);
          });
        } else {
          callback(err);
        }
      } else {
        self._getUserInfo(callback);
      }
    });
  };

  Account.prototype.checkLoginStatus = function (callback) {
    var self = this;
    var weChatCode = utils.getQueryString('code');
    if (!weChatCode && window.localStorage.getItem(self.weChatCodeTimeKey) > new Date().getTime()) {
      weChatCode = window.localStorage.getItem(self.weChatCodeKey);
    }
    self.code = weChatCode;
    self._getAccess(function (err, token) {
      if (err) {
        if (self.inWeChat) {
          // 存在from可能为分享消息，code可能与当前账号不符，重新授权
          var from = utils.getQueryString('from');
          if (from && self.forceLogin) {
            return self._getWechatAccess();
          }
          if (weChatCode) {
            window.localStorage.setItem(self.weChatCodeKey, weChatCode);
            window.localStorage.setItem(self.weChatCodeTimeKey, new Date().getTime() + 110 * 60 * 1000);
            self.ajax({
              auth: false,
              type: 'POST',
              path: '/s/user/login/social',
              data: {
                socialCode: weChatCode,
                socialType: config.socialType,
                checkVersion: 0
              },
              success: function success(result) {
                self.socialBinded = true;
                self._saveToken(result);
                self.token = result.access_token;
                self._saveOpenId(result.socialId);
                callback(null, result);
              },
              error: function error(err) {
                self.socialBinded = false;
                callback(err);
              }
            });
          } else {
            if (self.forceLogin) return self._getWechatAccess();
            return callback(err);
          }
        } else {
          callback(err);
        }
      } else {
        callback(null, token);
      }
    });
  };

  Account.prototype.ajax = function (options) {
    var self = this;
    var opt = $.extend({
      auth: true
    }, options);
    if (opt.auth) {
      self.login(function () {
        opt.headers = $.extend(opt.headers || {}, {
          Authorization: 'Bearer ' + self.token
        });
        self._ajax(opt);
      });
    } else {
      self._ajax(opt);
    }
  };

  Account.prototype._ajax = function (options) {
    if (!options.ignoreLoading) {
      utils.showLoading();
    }
    $.ajax({
      type: options.type || 'GET',
      url: config.apiUrl + options.path,
      data: options.data || {},
      headers: options.headers || {},
      dataType: 'json',
      async: options.async,
      timeout: config.requestTimeout,
      success: function success(result) {
        if (!options.ignoreLoading) {
          utils.hideLoading();
        }
        if (options.success) options.success(result);
      },
      error: function error(xhr, errorType, _error) {
        if (!options.ignoreLoading) {
          utils.hideLoading();
        }
        var apiError = {};
        try {
          apiError = JSON.parse(xhr.responseText);
        } catch (e) {
          if ($('meta[name="_token"]').attr('content')) {
            $.ajax({
              type: 'POST',
              url: '/wx/error',
              data: {
                type: options.type || 'GET',
                uri: config.apiUrl + options.path,
                data: options.data,
                status: xhr.status,
                errorType: errorType,
                error: _error
              },
              headers: {
                'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
              }
            });
          }
          apiError = { code: 'unknown.error', message: '网络请求错误' };
        }
        if (options.error) options.error(apiError);
      }
    });
  };

  Account.prototype._getUserInfo = function (callback) {
    var self = this;
    self.ajax({
      path: '/s/user',
      success: function success(result) {
        window.localStorage.setItem(self.userInfoKey, JSON.stringify(result));
        $('#current-account').text(result.mobile);
        $('#account-info').show();
        callback(null, result);
      },
      error: function error(err) {
        callback(err);
      }
    });
  };

  Account.prototype._getAccess = function (callback) {
    var self = this;

    if (self.inWeChat) {
      var socialId = window.localStorage.getItem(self.openId);
      if (self.socialBinded && !socialId) return callback({ code: 'error' });
    }

    try {
      var accessString = window.localStorage.getItem(self.accessKey);
      if (!accessString) {
        return callback({ code: 'access.not.exist', message: '未登录' });
      }
      var access = JSON.parse(accessString);
      var token = access.access_token;
      var expireAt = access.expire_at;
      var refreshToken = access.refresh_token;
      self.token = token;
      if (new Date().getTime() / 1000 < expireAt) {
        callback(null, token);
      } else {
        self.ajax({
          auth: false,
          type: 'POST',
          path: '/s/user/refresh',
          data: {
            refresh_token: refreshToken
          },
          success: function success(result) {
            self._saveToken(result);
            self.token = result.access_token;
            callback(null, result.access_token);
          },
          error: function error(err) {
            callback(err);
          }
        });
      }
    } catch (e) {
      callback(e);
    }
  };

  Account.prototype._tryUnbindSocial = function () {
    var self = this;
    var accessString = window.localStorage.getItem(self.accessKey);
    var weChatCode = window.localStorage.getItem(self.weChatCodeKey);
    var weChatCodeTime = window.localStorage.getItem(self.weChatCodeTimeKey);
    if (self.inWeChat && accessString) {
      self.ajax({
        type: 'DELETE',
        path: '/s/user/social/wx-jqfx',
        async: false
      });
    }
    if (self.inWeChat && weChatCodeTime && (!weChatCode || weChatCodeTime < new Date().getTime())) {
      return self._getWechatAccess();
    }
  };

  Account.prototype._saveToken = function (tokenObj) {
    this.token = tokenObj.access_token;
    tokenObj.expire_at = new Date().getTime() / 1000 + tokenObj.expires_in - 600;
    window.localStorage.setItem(this.accessKey, JSON.stringify(tokenObj));
  };

  Account.prototype._saveOpenId = function (openId) {
    window.localStorage.setItem(this.openId, openId);
  };

  Account.prototype._getWechatAccess = function () {
    window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + config.APPID + '&redirect_uri=' + encodeURI(this.returnUrl) + '&response_type=code&scope=snsapi_userinfo' + utils.saveUrlParam() + '#wechat_redirect';
  };

  Account.prototype.setAuthCallback = function (func) {
    window.localStorage.setItem(this.authCallbackKey, func || '');
  };

  Account.prototype.getAuthCallback = function () {
    return window.localStorage.getItem(this.authCallbackKey);
  };

  Account.prototype._showLogin = function (callback, loginFirst) {
    var self = this;
    if (self.inWeChat) {
      var weChatCode = utils.getQueryString('code');
      if (!weChatCode && window.localStorage.getItem(self.weChatCodeTimeKey) > new Date().getTime()) {
        weChatCode = window.localStorage.getItem(self.weChatCodeKey);
      }
      if (!weChatCode) {
        return self._getWechatAccess();
      }
    }
    var html = '<div id="login" class="login-mask">' + '  <div class="login-box">' + '    <form id="loginForm" class="login-form">' + '      <div class="login-title">手机号登录</div>' + '      <input id="loginMobile" placeholder="手机号" type="tel" maxlength="11">' + '      <input id="loginPassword" placeholder="密码" type="password" maxlength="12">' + '      <div id="loginBtn" class="submit-btn">登录</div>' + '      <div id="forgetPassword">忘记密码?</div>' + '      <div id="switchRegister">注册账号</div>' + '    </form>' + '    <form id="registerForm" class="register-form">' + '      <div class="login-title">新用户注册</div>' + '      <input id="regMobile" placeholder="手机号" type="tel" maxlength="11">' + '      <input id="regSmsCode" placeholder="验证码" type="tel" maxlength="4">' + '      <div id="regSmsBtn" class="send-btn">获取验证码</div>' + '      <input id="regPassword" placeholder="6～12位新密码，数字加字母" type="password" maxlength="12">' + '      <span id="showHideRegPassword" class="hide"></span>' + '      <div id="regBtn" class="submit-btn">注册</div>' + '      <div id="switchLogin">已有账号？<span class="underline">立即登录</span></div>' + '    </form>' + '    <form id="resetForm" class="reset-form">' + '      <div id="backLogin"></div>' + '      <div class="login-title">找回密码</div>' + '      <input id="resetMobile" placeholder="手机号" type="tel" maxlength="11">' + '      <input id="resetSmsCode" placeholder="验证码" type="tel" maxlength="4">' + '      <div id="resetSmsBtn" class="send-btn">获取验证码</div>' + '      <input id="resetPassword" placeholder="6～12位新密码，数字加字母" type="password" maxlength="12">' + '      <span id="showHideResetPassword" class="hide"></span>' + '      <div id="resetBtn" class="submit-btn">完成并登录</div>' + '    </form>' + '  </div>' + '</div>' + '<style>' + '.login-mask{position:fixed;width:100%;height:100%;top:0;background-color:rgba(0,0,0,.8);z-index:1003;overflow:hidden;display:none;font-family:VarelaRound-Regular,PingFangSC-Light,Microsoft YaHei}.login-mask *{-webkit-box-sizing:border-box;box-sizing:border-box}.login-mask .login-box{width:78.667vw;margin:35% auto;overflow:hidden;background-color:#fff;border-radius:3.2vw;position:relative;padding:0;content:"viewport-units-buggyfill; width: 78.667vw; border-radius: 3.2vw"}.login-mask form{margin:8.533vw auto;content:"viewport-units-buggyfill; margin: 8.533vw auto"}.login-mask input{margin:2.133vw auto 0;display:block;width:68vw;height:12.267vw;line-height:normal;font-size:3.733vw;font-family:VarelaRound-Regular;text-indent:5.333vw;outline:none;color:#4b5058;background:#fff;border-radius:6.133vw;border:.267vw solid #f2f2f2;-webkit-appearance:none;-moz-appearance:none;appearance:none;content:"viewport-units-buggyfill; margin: 2.133vw auto 0 auto; width: 68vw; height: 12.267vw; font-size: 3.733vw; text-indent: 5.333vw; border-radius: 6.133vw; border: 0.267vw solid #f2f2f2"}.login-mask input:-ms-input-placeholder,.login-mask input::-ms-input-placeholder{font-weight:300;font-family:PingFangSC-Light;color:#c1c1c1}.login-mask input::-webkit-input-placeholder{font-weight:300;font-family:PingFangSC-Light;color:#c1c1c1}.login-mask input:-ms-input-placeholder,.login-mask input::-ms-input-placeholder{font-weight:300;font-family:PingFangSC-Light;color:#c1c1c1}.login-mask input::placeholder{font-weight:300;font-family:PingFangSC-Light;color:#c1c1c1}.login-mask .login-title{height:7.467vw;margin-bottom:6.4vw;line-height:7.467vw;font-size:5.333vw;font-family:PingFangSC-Medium;color:#4b5058;text-align:center;content:"viewport-units-buggyfill; height: 7.467vw; margin-bottom: 6.4vw; line-height: 7.467vw; font-size: 5.333vw"}.login-mask .submit-btn{display:block;margin:2.133vw auto 0;width:68vw;height:12.8vw;line-height:12.8vw;background:hsla(216,8%,63%,.6);border-radius:6.4vw;font-size:4.267vw;font-family:PingFangSC-Medium;color:#e5e6e9;text-align:center;content:"viewport-units-buggyfill; margin: 2.133vw auto 0 auto; width: 68vw; height: 12.8vw; line-height: 12.8vw; border-radius: 6.4vw; font-size: 4.267vw"}.login-mask .active{background:#32cdff;color:#fff}.login-mask .send-btn{display:inline-block;width:24vw;height:12.8vw;line-height:12.8vw;font-size:3.733vw;font-weight:300;font-family:PingFangSC-Light;color:#4b5058;position:absolute;top:36.8vw;right:5.067vw;content:"viewport-units-buggyfill; width: 24vw; height: 12.8vw; line-height: 12.8vw; font-size: 3.733vw; top: 36.8vw; right: 5.067vw"}.login-mask .underline{text-decoration:underline}.login-mask #forgetPassword{margin:4.267vw 10.933vw 0 17.067vw;color:#999fa8;content:"viewport-units-buggyfill; margin: 4.267vw 10.933vw 0 17.067vw; width: 18.667vw; height: 5.333vw; line-height: 5.333vw; font-size: 3.733vw"}.login-mask #forgetPassword,.login-mask #switchRegister{display:inline-block;width:18.667vw;height:5.333vw;line-height:5.333vw;font-size:3.733vw;font-weight:300;font-family:PingFangSC-Light}.login-mask #switchRegister{color:#4b5058;content:"viewport-units-buggyfill; width: 18.667vw; height: 5.333vw; line-height: 5.333vw; font-size: 3.733vw"}.login-mask #backLogin{position:absolute;top:9.333vw;left:6.667vw;width:6.4vw;height:6.4vw;background:url("");background-size:6.4vw 6.4vw;content:"viewport-units-buggyfill; top: 9.333vw; left: 6.667vw; width: 6.4vw; height: 6.4vw; background-size: 6.4vw 6.4vw"}.login-mask #switchLogin{margin:4.267vw auto 0;text-align:center;height:5.333vw;font-size:3.733vw;font-family:PingFangSC-Regular;color:#4b5058;content:"viewport-units-buggyfill; margin: 4.267vw auto 0 auto; height: 5.333vw; font-size: 3.733vw"}.login-mask #showHideRegPassword,.login-mask #showHideResetPassword{position:absolute;display:block;top:51.2vw;right:5.333vw;width:13.6vw;height:12.267vw;background-size:4.267vw 4.267vw;background-repeat:no-repeat;background-position:4vw 4vw;content:"viewport-units-buggyfill; top: 51.2vw; right: 5.333vw; width: 13.6vw; height: 12.267vw; background-size: 4.267vw 4.267vw; background-position: 4vw 4vw"}.login-mask #showHideRegPassword.show,.login-mask #showHideResetPassword.show{background-image:url("")}.login-mask #showHideRegPassword.hide,.login-mask #showHideResetPassword.hide{background-image:url("")}' + '</style>';

    if (!$('#login').length) $('body').append(html);

    self._initLoginEvent(callback);

    $('#resetForm, #loginForm').css('display', 'none');
    $('#registerForm').css('display', 'block');
    $('.login-mask').css('display', 'block');
    $('body').css({ 'position': 'fixed', 'width': '100%' });
  };

  //限制输入数字
  $.fn.onlyNum = function () {
    $(this).keypress(function (event) {
      var eventObj = event || e;
      var keyCode = eventObj.keyCode || eventObj.which;
      if (keyCode >= 48 && keyCode <= 57) return true;else return false;
    }).focus(function () {
      //禁用输入法
      this.style.imeMode = 'disabled';
    }).bind('paste', function () {
      //获取剪切板的内容
      var clipboard = window.event.clipboardData.getData('text');
      if (/^\d+$/.test(clipboard)) return true;else return false;
    });
  };

  Account.prototype._initLoginEvent = function (callback) {
    if (typeof callback !== 'function') callback = function callback() {};
    var self = this;

    // 表单校验
    $('#login input').off('input change').on('input change', function () {
      if ($('#loginMobile').val().length === 11 && $('#loginPassword').val().length >= 6 && $('#loginPassword').val().length <= 12 && /^[0-9]*$/.test($('#loginMobile').val()) && /^[0-9a-zA-Z]*$/.test($('#loginPassword').val())) {
        $('#loginBtn').addClass('active');
      } else {
        $('#loginBtn').removeClass('active');
      }
      if ($('#regMobile').val().length === 11 && $('#regSmsCode').val().length === 4 && $('#regPassword').val().length >= 6 && $('#regPassword').val().length <= 12 && /^[0-9]*$/.test($('#regMobile').val()) && /^[0-9]*$/.test($('#regSmsCode').val()) && /^[0-9a-zA-Z]*$/.test($('#regPassword').val())) {
        $('#regBtn').addClass('active');
      } else {
        $('#regBtn').removeClass('active');
      }
      if ($('#resetMobile').val().length === 11 && $('#resetSmsCode').val().length === 4 && $('#resetPassword').val().length >= 6 && $('#resetPassword').val().length <= 12 && /^[0-9]*$/.test($('#resetMobile').val()) && /^[0-9]*$/.test($('#resetSmsCode').val()) && /^[0-9a-zA-Z]*$/.test($('#resetPassword').val())) {
        $('#resetBtn').addClass('active');
      } else {
        $('#resetBtn').removeClass('active');
      }
    });

    // 显示隐藏密码
    $('#showHideRegPassword').off('click').on('click', function () {
      if ($('#showHideRegPassword').attr('class') === 'hide') {
        $('#regPassword').attr('type', 'text');
        $('#showHideRegPassword').attr('class', 'show');
      } else {
        $('#regPassword').attr('type', 'password');
        $('#showHideRegPassword').attr('class', 'hide');
      }
    });
    $('#showHideResetPassword').off('click').on('click', function () {
      if ($('#showHideResetPassword').attr('class') === 'hide') {
        $('#resetPassword').attr('type', 'text');
        $('#showHideResetPassword').attr('class', 'show');
      } else {
        $('#resetPassword').attr('type', 'password');
        $('#showHideResetPassword').attr('class', 'hide');
      }
    });

    // 验证码只能是数字
    $('#loginMobile, #regMobile, #resetMobile, #regSmsCode, #resetSmsCode').onlyNum();

    // 清空密码和按钮状态
    $('#loginPassword, #regSmsCode, #regPassword, #resetSmsCode, #resetPassword').val('');
    $('#loginBtn, #regBtn, #resetBtn').removeClass('active');

    // 阻止关闭点击冒泡
    $('.login-box').off('click').on('click', function (e) {
      e.stopPropagation();
    });

    // 已有账号
    $('#switchLogin').off('click').on('click', function () {
      $('#resetForm, #registerForm').css('display', 'none');
      $('#loginForm').css('display', 'block');
    });
    // 还没有账号
    $('#switchRegister').off('click').on('click', function () {
      $('#loginForm, #resetForm').css('display', 'none');
      $('#registerForm').css('display', 'block');
    });
    // 忘记密码
    $('#forgetPassword').off('click').on('click', function () {
      $('#loginForm, #registerForm').css('display', 'none');
      $('#resetForm').css('display', 'block');
    });
    // 返回登录
    $('#backLogin').off('click').on('click', function () {
      $('#resetForm, #registerForm').css('display', 'none');
      $('#loginForm').css('display', 'block');
    });

    // 关闭登录窗口
    $('.login-mask').click(function () {
      $('.login-mask').css('display', 'none');
      $('body').css({ 'position': 'relative' });
    });

    var countdown = 60;

    // 发送注册验证码
    $('#regSmsBtn').off('click').on('click', function () {

      if (countdown !== 60) return;

      var mobile = $.trim($('#regMobile').val());

      if (!checkMobile(mobile)) false;

      self.ajax({
        auth: false,
        type: 'POST',
        path: '/s/user/sms/register',
        data: {
          mobile: mobile
        },
        success: function success() {
          setTime($('#regSmsBtn'));
          utils.toast('验证码已经发送');
        },
        error: function error(_error2) {
          utils.toast(_error2.message);
        }
      });
    });

    // 注册用户
    $('#regBtn').off('click').on('click', function () {
      if (self.accountLoading) return;
      self.accountLoading = true;
      var mobile = $.trim($('#regMobile').val());
      var verifyCode = $.trim($('#regSmsCode').val());
      var password = $.trim($('#regPassword').val());

      //检查手机
      if (!checkMobile(mobile)) {
        self.accountLoading = false;
        return false;
      }

      //检查验证码
      if (verifyCode.length !== 4) {
        utils.toast('手机验证码为4位数字');
        self.accountLoading = false;
        return false;
      }

      //检查密码
      if (!checkPassword(password)) {
        self.accountLoading = false;
        return false;
      }

      //查找reference

      var reference = '';
      try {
        var referenceObj = JSON.parse(window.localStorage.getItem(self.referenceKey));
        if (referenceObj && referenceObj.rawData && new Date().getTime() / 1000 < referenceObj.expires) {
          reference = referenceObj.rawData;
        }
      } catch (e) {
        console.log(e);
      }
      var channel = '';
      try {
        var channelObj = JSON.parse(window.localStorage.getItem(self.channleKey));
        if (channelObj && channelObj.rawData && new Date().getTime() / 1000 < channelObj.expires) {
          channel = channelObj.rawData;
        }
      } catch (e) {
        console.log(e);
      }

      self.ajax({
        auth: false,
        type: 'POST',
        path: self.inWeChat && self.code ? '/s/user/register/withSocial' : '/s/user/register',
        data: {
          mobile: mobile,
          smsCode: verifyCode,
          password: password,
          reference: reference,
          channel: channel,
          socialType: config.socialType,
          socialCode: self.code
        },
        success: function success(data) {
          self.accountLoading = false;
          _hideLogin(mobile);
          self.socialBinded = true;
          self._saveToken(data);
          self._saveOpenId(data.socialId);
          callback(null, data);
        },
        error: function error(err) {
          self.accountLoading = false;
          utils.toast(err.message);
          callback(err);
        }
      });
    });

    // 登录
    $('#loginBtn').off('click').on('click', function () {
      if (self.accountLoading) return;
      self.accountLoading = true;
      var mobile = $.trim($('#loginMobile').val());
      var password = $.trim($('#loginPassword').val());

      if (!checkMobile(mobile)) {
        self.accountLoading = false;
        return false;
      }
      //检查密码
      if (!checkPassword(password)) {
        self.accountLoading = false;
        return false;
      }
      self._tryUnbindSocial();

      self.ajax({
        auth: false,
        type: 'POST',
        path: '/s/user/login',
        data: {
          mobile: mobile,
          password: password,
          checkVersion: 0
        },
        beforeSend: function beforeSend() {
          self.accountLoading = false;
        },
        success: function success(data) {
          self.accountLoading = false;
          _hideLogin(mobile);
          self._saveToken(data);
          if (self.inWeChat) {
            self.ajax({
              type: 'POST',
              path: '/s/user/social',
              data: {
                socialType: config.socialType,
                socialCode: self.code
              },
              success: function success(result) {
                self.socialBinded = true;
                self._saveOpenId(result.socialId);
                callback(null, data);
              }
            });
          } else {
            callback(null, data);
          }
        },
        error: function error(err) {
          self.accountLoading = false;
          utils.toast(err.message);
          $('#loginBtn').find('.loading-icon').show();
          $('#loginBtn').find('.right-arrow-icon').show().siblings('.loading-icon').hide();
        }
      });
    });

    // 发送重设密码验证码
    countdown = 60;
    $('#resetSmsBtn').off('click').on('click', function () {
      if (countdown !== 60) return;

      var mobile = $.trim($('#resetMobile').val());

      if (!checkMobile(mobile)) false;

      self.ajax({
        auth: false,
        type: 'POST',
        path: '/s/user/sms/password',
        data: {
          mobile: mobile
        },
        dataType: 'json',
        success: function success(result) {
          setTime($('#resetSmsBtn'));
          utils.toast('验证码已经发送');
        },
        error: function error(err) {
          utils.toast(err.message);
        }
      });
    });

    //重置密码
    $('#resetBtn').off('click').on('click', function () {
      if (self.accountLoading) return;
      self.accountLoading = true;

      var mobile = $.trim($('#resetMobile').val());
      var verifyCode = $.trim($('#resetSmsCode').val());
      var password = $.trim($('#resetPassword').val());

      //检查手机
      if (!checkMobile(mobile)) {
        self.accountLoading = false;
        return false;
      }

      //检查验证码
      if (verifyCode.length !== 4) {
        utils.toast('手机验证码为4位数字');
        self.accountLoading = false;
        return false;
      }

      //检查密码
      if (!checkPassword(password)) {
        self.accountLoading = false;
        return false;
      }

      self.ajax({
        auth: false,
        type: 'POST',
        path: '/s/user/password/reset',
        data: {
          mobile: mobile,
          smsCode: verifyCode,
          password: password
        },
        success: function success(data) {
          self.accountLoading = false;
          utils.toast('密码成功重置,请登录');
          $('#resetForm, #registerForm').css('display', 'none');
          $('#loginForm').css('display', 'block');
        },

        error: function error(err) {
          self.accountLoading = false;
          utils.toast(err.message);
        }
      });
    });

    //启动计时器
    function setTime(obj) {
      if (countdown === 0) {
        obj.attr('disabled', false);
        obj.text('发送验证码');
        countdown = 60;
        return;
      } else {
        obj.attr('disabled', false);
        obj.text(countdown + 's');
      }
      countdown--;

      setTimeout(function () {
        setTime(obj);
      }, 1000);
    }

    // 检查手机号
    function checkMobile(mobile) {
      var pregMobile = /^1\d{10}$/;
      if ($.trim(mobile) === '') {
        utils.toast('手机号不能为空');
        return false;
      }

      if (!pregMobile.test(mobile)) {
        utils.toast('不是有效的手机号');
        return false;
      }
      return true;
    }

    // 检查密码
    function checkPassword(password) {
      //字段值仅允许字母、数字、破折号（-）以及底线（_）
      var pregPassword = /^[0-9A-Za-z_-]{6,30}$/;
      if (password === '' || password.length < 6 || password.length > 32) {
        utils.toast('密码长度为6-32位');
        return false;
      }

      if (!pregPassword.test(password)) {
        utils.toast('密码长度6到10位,仅允许字母，数字，破折号，底线 ');
        return false;
      }
      return true;
    }

    function _hideLogin(mobile) {
      // 删除本地userid
      localStorage.removeItem('userId');
      utils.toast('成功登录');
      $('.login-mask').css('display', 'none');
      $('body').css({ 'position': 'relative' });

      //记录当前手机号
      localStorage.setItem('mobile', mobile);
      $('#current-account').text(mobile.replace(mobile.substr(3, 4), '****'));
      $('#account-info').show();
    }
  };

  // Account.prototype._getRecommendation = function(callback) {
  //     var self = this;
  //     self.checkLoginStatus(function (err, authObj) {
  //         if (err) {
  //             self._showLogin(callback);
  //         } else {
  //             callback(err, authObj);
  //         }
  //     });
  // };

  Account.init = function (options) {
    return new Account(options);
  };

  if (typeof define === 'function' && _typeof(define.amd) === 'object' && define.amd) {
    define(function () {
      return Account;
    });
  } else if (typeof module !== 'undefined' && module.exports) {
    module.exports = Account.init;
    module.exports.Account = Account;
  }
  window.Account = Account;
})(window.Zepto);

if (!window.utils) window.utils = {};
var _utils = {
  noop: function noop() {},
  setBackUrl: function setBackUrl(url) {
    window.history.pushState(null, '', window.location.href);
    window.addEventListener('popstate', function () {
      window.location.href = url;
    }, false);
  },
  isEmpty: function isEmpty(obj) {
    if (obj === null) return true;
    var type = Object.prototype.toString.call(obj);
    if (type === '[object Array]' || type === '[object String]') {
      return obj.length === 0;
    }
    if (type === '[object Number]') {
      return obj === 0;
    }
    for (var name in obj) {
      return false;
    }
    return true;
  },
  getQueryString: function getQueryString(name) {
    var r1 = getMatched(name, window.location.search);
    if (r1) return r1;
    var key = arguments[1];
    if (key) {
      return getMatched(name, window.localStorage.getItem(key));
    }
    return null;

    function getMatched(name, string) {
      if (string) {
        var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
        var len = string.indexOf('?') == 0 ? 1 : 0;
        var r = string.substr(len).match(reg);
        if (r != null) return unescape(r[2]);
      }
      return null;
    }
  },
  isWeChat: function isWeChat() {
    return (/(MicroMessenger)/i.test(navigator.userAgent)
    );
  },
  isIOS: function isIOS() {
    return (/iPad|iPhone|iPod/.test(navigator.platform)
    );
  },
  isIosWebView: function isIosWebView() {
    return (/iPad|iPhone|iPod/.test(navigator.platform) && navigator.userAgent.indexOf('Safari') === -1
    );
  },
  isAndroid: function isAndroid() {
    return (/(android)/i.test(navigator.userAgent)
    );
  },
  isAndroidWebView: function isAndroidWebView() {
    return (/(android)/i.test(navigator.userAgent) && (typeof android === "undefined" ? "undefined" : _typeof(android)) === 'object'
    );
  },
  isWebView: function isWebView() {
    return utils.isIosWebView() || utils.isAndroidWebView();
  },
  isMobile: function isMobile() {
    return utils.isIOS() || utils.isAndroid();
  },
  parseUrlParam: function parseUrlParam(key) {
    var match,
        pl = /\+/g,
        // Regex for replacing addition symbol with a space
    search = /([^&=]+)=?([^&]*)/g,
        decode = function decode(s) {
      return decodeURIComponent(s.replace(pl, ' '));
    },
        query = window.location.search.substring(1),
        params = {};
    while (match = search.exec(query)) {
      params[decode(match[1])] = decode(match[2]);
    }return key ? params[key] : params;
  },
  parseUrlHash: function parseUrlHash(key) {
    var match,
        pl = /\+/g,
        // Regex for replacing addition symbol with a space
    search = /([^&=]+)=?([^&]*)/g,
        decode = function decode(s) {
      return decodeURIComponent(s.replace(pl, ' '));
    },
        query = window.location.hash.substring(1),
        params = {};
    while (match = search.exec(query)) {
      params[decode(match[1])] = decode(match[2]);
    }return key ? params[key] : params;
  },
  saveUrlParam: function saveUrlParam() {
    var param = utils.getUrlParam();
    try {
      if (param) {
        var state = Math.random().toString().slice(-6);
        delete param.state;
        delete param.code;
        window.localStorage.setItem('param_' + state, JSON.stringify(param));
        console.log('save url param: ', param);
        return '&state=' + state;
      }
    } catch (e) {}
    return '';
  },
  recoverUrlParam: function recoverUrlParam() {
    var state = utils.getUrlParam('state');
    try {
      var param = JSON.parse(window.localStorage.getItem('param_' + state));
      delete param.state;
      delete param.code;
      utils.setUrlParam(param);
      window.localStorage.removeItem('param_' + state);
      return param;
    } catch (e) {}
  },
  getUrlParam: function getUrlParam(key) {
    return utils.parseUrlParam(key);
  },
  getUrlHash: function getUrlHash(key) {
    return utils.parseUrlHash(key);
  },
  getUrlParamWithState: function getUrlParamWithState(key) {
    if (utils.parseUrlParam(key)) return utils.parseUrlParam(key);else if (utils.parseUrlParam('state')) {
      try {
        return JSON.parse(utils.base64ToUtf8(utils.getUrlParam('state')))[key];
      } catch (e) {
        return '';
      }
    }
    return '';
  },
  toUrlParam: function toUrlParam(obj) {
    var arr = [];
    for (var key in obj) {
      arr.push(key + '=' + encodeURIComponent(obj[key]));
    }
    return arr.join('&');
  },
  toUrlHash: function toUrlHash(obj) {
    var arr = [];
    for (var key in obj) {
      arr.push(key + '=' + encodeURIComponent(obj[key]));
    }
    return arr.join('&');
  },
  deleteUrlParam: function deleteUrlParam(key) {
    var params = utils.getUrlParam();
    if (params[key]) {
      delete params[key];
      window.history.pushState(null, null, location.pathname + '?' + utils.toUrlParam(params));
    }
  },
  updateUrlParam: function updateUrlParam(obj) {
    for (var key in obj) {
      utils.deleteUrlParam(key);
    }window.history.pushState(null, null, location.href + (/\?/.test(location.href) ? '&' : '?') + utils.toUrlParam(obj));
  },
  setUrlParam: function setUrlParam(obj) {
    var params = utils.getUrlParam();
    for (var key in obj) {
      if (params[key]) {
        var t = {};
        t[key] = obj[key];
        utils.updateUrlParam(t);
      } else {
        var t = {};
        t[key] = obj[key];
        window.history.pushState(null, null, location.href + (/\?/.test(location.href) ? '&' : '?') + utils.toUrlParam(t));
      }
    }
  },
  format: function format(x, y) {
    var z = {
      y: x.getFullYear(),
      M: x.getMonth() + 1,
      d: x.getDate(),
      h: x.getHours(),
      m: x.getMinutes(),
      s: x.getSeconds()
    };
    return y.replace(/(y+|M+|d+|h+|m+|s+)/g, function (v) {
      return ((v.length > 1 ? '0' : '') + eval('z.' + v.slice(-1))).slice(-(v.length > 2 ? v.length : 2));
    });
  },
  alert: function alert(options, yesText) {
    if (typeof options === 'string') {
      // 兼容直接传字符串作为参数的写法
      options = {
        id: Math.ceil(Math.random() * 1000000000),
        message: options,
        yesText: typeof yesText === 'string' ? yesText : '好的',
        yes: utils.noop,
        mask: true
      };
    } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === 'object') {
      options.id = options.id || Math.ceil(Math.random() * 1000000000);
      options.message = options.message || '确定要这么做吗?';
      options.yesText = options.yesText || '好的';
      options.yes = options.yes || function () {};
      options.mask = !options.mask;
    } else return;

    // 创建提示对话框面板
    var alertMask = document.createElement('div');
    alertMask.setAttribute('id', 'alert-mask-' + options.id);
    alertMask.className = 'alert-mask hidden';
    if (!options.mask) alertMask.style.background = 'transparent';
    alertMask.innerHTML = '<div id="alert-box-' + options.id + '" class="alert hidden">' + '  <div class="title">' + options.message + '</div>' + '  <div id="alert-ok-' + options.id + '" class="button">' + options.yesText + '</div>' + '</div>' + '<style>' + '.alert-mask{position:fixed;top:0;width:100%;height:100%;background:rgba(0,0,0,.8);z-index:1005;overflow:hidden;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .25s linear 0s;transition:opacity .25s linear 0s}.alert-mask .alert{width:78.667vw;background:#fff;border-radius:2.133vw;text-align:center;-webkit-transition:-webkit-transform .25s linear 0s;transition:-webkit-transform .25s linear 0s;transition:transform .25s linear 0s;transition:transform .25s linear 0s,-webkit-transform .25s linear 0s;content:"viewport-units-buggyfill; width: 78.667vw; border-radius: 2.133vw"}.alert-mask .alert .title{padding:0 5.333vw;min-height:25.6vw;font-size:4.267vw;font-family:VarelaRound-Regular;color:#676c75;line-height:6.4vw;border-bottom:.267vw solid #e7e8ea;content:"viewport-units-buggyfill; padding: 0 5.333vw; min-height: 25.6vw; font-size: 4.267vw; line-height: 6.4vw; border-bottom: 0.267vw solid #e7e8ea"}.alert-mask .alert .button,.alert-mask .alert .title{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.alert-mask .alert .button{min-height:15.2vw;font-size:4.8vw;font-family:PingFangSC-Medium;color:#32cdff;line-height:6.667vw;content:"viewport-units-buggyfill; min-height: 15.2vw; font-size: 4.8vw; line-height: 6.667vw"}.alert-mask .alert.show{-webkit-transform:scale(1);transform:scale(1)}.alert-mask .alert.hidden{-webkit-transform:scale(0);transform:scale(0)}.alert-mask.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.alert-mask.hidden{display:none;opacity:0}' + '</style>';

    add();

    // 绑定点击事件
    document.getElementById('alert-ok-' + options.id).addEventListener('click', remove, false);

    function add() {
      document.body.appendChild(alertMask);
      document.body.style.overflow = 'hidden';
      alertMask.className = 'alert-mask show';
      setTimeout(function () {
        document.getElementById('alert-box-' + options.id).className = 'alert show';
      }, 0);
    }

    function remove() {
      document.getElementById('alert-box-' + options.id).className = 'alert hidden';
      setTimeout(function () {
        alertMask.className = 'alert-mask hidden';
        document.body.style.overflow = 'auto';
        document.body.removeChild(document.getElementById('alert-mask-' + options.id));
        options.yes(true);
      }, 250);
    }
  },
  utf8ToBase64: function utf8ToBase64(str) {
    return btoa(unescape(encodeURIComponent(str)));
  },
  base64ToUtf8: function base64ToUtf8(str) {
    return decodeURIComponent(escape(atob(str)));
  },
  info: function info(options, contentText) {
    if (typeof options === 'string') {
      // 兼容直接传字符串作为参数的写法
      options = {
        title: options,
        content: typeof contentText === 'string' ? contentText : ''
      };
    } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === 'object') {
      options.title = options.title || '';
      options.content = options.content || '';
    } else return;

    options.id = options.id || Math.ceil(Math.random() * 1000000000);
    options.yes = options.yes || utils.noop;
    options.mask = options.mask === undefined ? true : Boolean(options.mask);

    // 创建提示对话框面板
    var infoMask = document.createElement('div');
    infoMask.setAttribute('id', 'info-mask-' + options.id);
    infoMask.className = 'info-mask hidden';
    if (!options.mask) infoMask.style.background = 'transparent';
    infoMask.innerHTML = '<div id="info-box-' + options.id + '" class="info hidden">' + '  <div class="title">' + options.title + '</div>' + '  <div class="content">' + options.content + '</div>' + '  <div id="info-close-' + options.id + '" class="close"></div>' + '</div>' + '<style>' + '.info-mask{position:fixed;top:0;width:100%;height:100%;background:rgba(0,0,0,.8);z-index:1004;overflow:hidden;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:opacity .25s linear 0s;transition:opacity .25s linear 0s}.info-mask .info{width:79.733vw;background:#fff;border-radius:2.133vw;text-align:center;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:-webkit-transform .25s linear 0s;transition:-webkit-transform .25s linear 0s;transition:transform .25s linear 0s;transition:transform .25s linear 0s,-webkit-transform .25s linear 0s;padding:6.933vw 7.467vw 8.267vw;color:#333;content:"viewport-units-buggyfill; width: 79.733vw; border-radius: 2.133vw; padding: 6.933vw 7.467vw 8.267vw 7.467vw"}.info-mask .info .title{height:10.4vw;font-size:4.267vw;font-family:PingFangSC-Medium;font-weight:500;content:"viewport-units-buggyfill; height: 10.4vw; font-size: 4.267vw"}.info-mask .info .content{min-height:22.4vw;font-size:3.733vw;font-family:PingFangSC-Regular;font-weight:400;line-height:5.6vw;text-align:left;content:"viewport-units-buggyfill; min-height: 22.4vw; font-size: 3.733vw; line-height: 5.6vw"}.info-mask .info .close{display:inline-block;width:10.133vw;height:10.133vw;margin-left:-5.067vw;position:absolute;bottom:-36.8vw;background:url();background-size:100% 100%;content:"viewport-units-buggyfill; width: 10.133vw; height: 10.133vw; margin-left: -5.067vw; bottom: -36.8vw"}.info-mask .info.show{-webkit-transform:scale(1);transform:scale(1)}.info-mask .info.hidden{-webkit-transform:scale(0);transform:scale(0)}.info-mask.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.info-mask.hidden{display:none;opacity:0}' + '</style>';

    add();

    // 绑定点击事件
    document.getElementById('info-close-' + options.id).addEventListener('click', remove, false);

    function add() {
      document.body.appendChild(infoMask);
      document.body.style.overflow = 'hidden';
      infoMask.className = 'info-mask show';
      setTimeout(function () {
        document.getElementById('info-box-' + options.id).className = 'info show';
      }, 0);
    }

    function remove() {
      document.getElementById('info-box-' + options.id).className = 'info hidden';
      setTimeout(function () {
        infoMask.className = 'info-mask hidden';
        document.body.style.overflow = 'auto';
        document.body.removeChild(document.getElementById('info-mask-' + options.id));
        options.yes(true);
      }, 250);
    }
  },
  toast: function toast(options) {
    if (typeof options === 'string') {
      // 兼容直接传字符串作为参数的写法
      options = {
        message: options
      };
    } else if ((typeof options === "undefined" ? "undefined" : _typeof(options)) === 'object') {
      options.message = options.message || '';
    } else return;

    options.id = options.id || Math.ceil(Math.random() * 1000000000);
    options.timer = options.timer || 3000;
    options.callback = options.callback || utils.noop;
    options.mask = options.mask === undefined ? true : Boolean(options.mask);

    // 创建提示对话框面板
    var toastMask = document.createElement('div');
    toastMask.setAttribute('id', 'toast-mask-' + options.id);
    toastMask.className = 'toast-mask hidden';
    if (!options.mask) toastMask.style.background = 'transparent';
    toastMask.innerHTML = '<div id="toast-box-' + options.id + '" class="toast hidden">' + options.message + '</div>' + '<style>' + '.toast-mask{position:fixed;top:0;bottom:0;left:0;right:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;pointer-events:none;z-index:1004}.toast-mask .toast{min-width:45.333vw;max-width:48.667vw;padding:4vw;line-height:5.333vw;color:#fff;background-color:rgba(0,0,0,.5);border-radius:1.333vw;font-size:3.733vw;text-align:center;display:block;z-index:1009;content:"viewport-units-buggyfill; min-width: 45.333vw; max-width: 48.667vw; padding: 4vw; line-height: 5.333vw; border-radius: 1.333vw; font-size: 3.733vw"}.toast-mask .toast.show{-webkit-transform:scale(1);transform:scale(1)}.toast-mask .toast.hidden{-webkit-transform:scale(0);transform:scale(0)}.toast-mask.show{display:-webkit-box;display:-ms-flexbox;display:flex;opacity:1}.toast-mask.hidden{display:none;opacity:0}' + '</style>';

    add();
    setTimeout(remove, options.timer);

    function add() {
      document.body.appendChild(toastMask);
      document.body.style.overflow = 'hidden';
      toastMask.className = 'toast-mask show';
      setTimeout(function () {
        document.getElementById('toast-box-' + options.id).className = 'toast show';
      }, 0);
    }

    function remove() {
      document.getElementById('toast-box-' + options.id).className = 'toast hidden';
      setTimeout(function () {
        toastMask.className = 'toast-mask hidden';
        document.body.style.overflow = 'auto';
        document.body.removeChild(document.getElementById('toast-mask-' + options.id));
        options.callback(true);
      }, 250);
    }
  },
  showLoading: function showLoading(text) {
    if (document.getElementById('weui-loading_toast')) return;
    var dvMsg = document.createElement('div');
    dvMsg.className = 'weui-loading_toast';
    dvMsg.setAttribute('id', 'weui-loading_toast');
    dvMsg.innerHTML = '<div class="weui-mask_transparent"></div>' + '<div class="weui-toast">' + '    <i class="weui-loading"></i>' + '    <p class="weui-toast__content">' + (text || '正在加载') + '</p>' + '</div>' + '<style>' + '.weui-loading_toast .weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-loading_toast .weui-toast{position:fixed;z-index:5000;width:32vw;min-height:32vw;top:48vw;left:50%;margin-left:-16vw;background:hsla(0,0%,7%,.7);text-align:center;border-radius:1.333vw;color:#fff;content:"viewport-units-buggyfill; width: 32vw; min-height: 32vw; top: 48vw; margin-left: -16vw; border-radius: 1.333vw"}.weui-loading_toast .weui-toast .weui-loading{margin:5.867vw auto 2.667vw;width:10.133vw;height:10.133vw;vertical-align:baseline;display:inline-block;-webkit-animation:loading-rotate 1s steps(12) infinite;animation:loading-rotate 1s steps(12) infinite;background:transparent url() no-repeat;background-size:100%;content:"viewport-units-buggyfill; margin: 5.867vw auto 2.667vw auto; width: 10.133vw; height: 10.133vw"}@-webkit-keyframes loading-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.weui-loading_toast .weui-toast .weui-toast__content{margin:0 0 4vw;content:"viewport-units-buggyfill; margin: 0 0 4vw"}' + '</style>';
    document.body.appendChild(dvMsg);
  },
  hideLoading: function hideLoading() {
    document.getElementById('weui-loading_toast') && document.getElementById('weui-loading_toast').parentNode.removeChild(document.getElementById('weui-loading_toast'));
  },
  initWechatShare: function initWechatShare(defaultInfo) {
    defaultInfo = defaultInfo || {};
    console.log(defaultInfo);
    if (utils.isWeChat() && WxConfig) {
      window.wxconfig = new WxConfig(window.wechatConfig);
      window.shareMsg = function (shareMsgInfo) {
        shareMsgInfo = shareMsgInfo || {};
        shareMsgInfo = {
          title: shareMsgInfo.title || defaultInfo.title || '【Qkids久趣】4-12岁，在家跟北美外教学英语，新用户100元体验！',
          desc: shareMsgInfo.desc || defaultInfo.desc || '严选北美外教在线授课，创造趣味十足的课堂体验，让孩子爱学更有效。',
          link: shareMsgInfo.link || defaultInfo.link || window.location.protocol + '//' + window.location.host + '/wx',
          imgUrl: shareMsgInfo.imgUrl || defaultInfo.imgUrl || 'https://static-app.97kid.com/site-student/public/img/share.png',
          success: shareMsgInfo.success || defaultInfo.success || function (target) {
            analytics && analytics.send({
              event: 'share_success',
              attr: {
                target: target
              }
            });
          }
        };
        console.log(shareMsgInfo);
        return shareMsgInfo;
      };
      window.activeShare = function (shareMsgInfo) {
        window.wxconfig.activeShare('', '', window.shareMsg(shareMsgInfo));
      };
      window.activeShare();
    }
  },
  initAnalytics: function initAnalytics(av) {
    window.av = av;
    window.analytics = AV.analytics({
      appId: 'antYy9lOFi5mkU9QKjtYmRLM-gzGzoHsz',
      appKey: 'jqyWxLyobpsmdwsJddJlDheb',
      channel: utils.isWeChat() ? 'weixin' : ''
    });
  },
  error: function error(err) {
    console.error(err);
    utils.toast(err.message);
  },
  supportPromise: function supportPromise(account) {
    account.$ajax = function (options) {
      return new Promise(function (resolve, reject) {
        if (options.auth === false) account.ajax(_extends({}, options, { success: resolve, error: reject }));else {
          account.forceLogin = true;
          account.getUserInfo(function (err) {
            return !err && account.ajax(_extends({}, options, { success: resolve, error: reject }));
          });
        }
      });
    };
    account.$getUserInfo = function () {
      return new Promise(function (resolve) {
        account.getUserInfo(function (err, userInfo) {
          err && console.error(err);
          resolve(userInfo || null);
        });
      });
    };
  },
  goHome: function goHome(vip) {
    if (vip) utils.go('/vip');else if (Account) {
      var account = new Account();
      account.forceLogin = false; // 不强制登录
      account.getUserInfo(function (err, userInfo) {
        if (!err && userInfo && userInfo.isNewUser === false) utils.go('/vip');else utils.go('');
      });
    } else utils.go('');
  },
  go: function go(path) {
    window.location.href = window.location.protocol + '//' + window.location.host + '/wx' + path;
  }
};
for (var util in _utils) {
  window.utils[util] = _utils[util];
}window.randomName = function (gender) {
  var names = [['Aaron', 'Abdul', 'Abdullah', 'Abe', 'Abel', 'Abraham', 'Abram', 'Abriel', 'Ace', 'Adam', 'Adan', 'Addison', 'Ade', 'Aden', 'Adnan', 'Adonis', 'Adrian', 'Adriel', 'Ahmad', 'Ahmed', 'Aidan', 'Aiden', 'Ainsley', 'Ajay', 'Al', 'Alain', 'Alan', 'Alastair', 'Albert', 'Alberto', 'Albie', 'Alden', 'Aldo', 'Alec', 'Alejandro', 'Alen', 'Alesandro', 'Alex', 'Alexander', 'Alexis', 'Alfie', 'Alfonso', 'Alfred', 'Alfredo', 'Ali', 'Alistair', 'Allan', 'Allen', 'Alonzo', 'Aloysius', 'Alphonso', 'Alton', 'Alvin', 'Amari', 'Amir', 'Amit', 'Amos', 'Anand', 'Anderson', 'Andre', 'Andreas', 'Andres', 'Andrew', 'Andy', 'Angel', 'Angelo', 'Angus', 'Ansel', 'Anson', 'Anthony', 'Anton', 'Antonio', 'Antony', 'Apollo', 'Aran', 'Archer', 'Archie', 'Ari', 'Arjun', 'Arlo', 'Arman', 'Armando', 'Arnold', 'Aron', 'Arran', 'Arrie', 'Art', 'Arthur', 'Arturo', 'Arun', 'Arwin', 'Asa', 'Asad', 'Ash', 'Ashby', 'Asher', 'Ashley', 'Ashton', 'Aspen', 'Aston', 'Athan', 'Atticus', 'Aubrey', 'Audwin', 'August', 'Augustus', 'Austen', 'Austin', 'Avery', 'Axel', 'Ayaan', 'Ayden', 'Bailey', 'Barack', 'Barclay', 'Barnaby', 'Barney', 'Barrett', 'Barron', 'Barry', 'Bart', 'Bartholomew', 'Basil', 'Bastian', 'Baxter', 'Bay', 'Baylor', 'Bear', 'Beau', 'Beck', 'Beckett', 'Bellamy', 'Ben', 'Benedict', 'Benjamin', 'Benji', 'Benjy', 'Bennett', 'Bennie', 'Benny', 'Benson', 'Bentley', 'Bently', 'Bernard', 'Bernardo', 'Bernie', 'Bert', 'Bertie', 'Bertram', 'Bev', 'Bevan', 'Bill', 'Billy', 'Bjorn', 'Bladen', 'Blain', 'Blaine', 'Blair', 'Blaise', 'Blake', 'Blaze', 'Blue', 'Bob', 'Bobby', 'Bodie', 'Boris', 'Boston', 'Bowen', 'Boyd', 'Brad', 'Braden', 'Bradford', 'Bradley', 'Bradwin', 'Brady', 'Braeden', 'Bram', 'Branden', 'Brandon', 'Brantley', 'Braxton', 'Brayan', 'Brayden', 'Braydon', 'Braylon', 'Brendan', 'Brenden', 'Brendon', 'Brennan', 'Brent', 'Brenton', 'Bret', 'Brett', 'Brevin', 'Brevyn', 'Brian', 'Brice', 'Bridie', 'Brighton', 'Brinley', 'Brock', 'Brodie', 'Brody', 'Brogan', 'Bronson', 'Brooks', 'Bruce', 'Bruno', 'Bryan', 'Bryant', 'Bryce', 'Bryden', 'Brydon', 'Bryon', 'Bryson', 'Buck', 'Buddy', 'Burt', 'Burton', 'Buster', 'Butch', 'Byron', 'Cadby', 'Cade', 'Caden', 'Cael', 'Caelan', 'Caesar', 'Cai', 'Caiden', 'Cain', 'Caius', 'Cal', 'Cale', 'Caleb', 'Calhoun', 'Callan', 'Callen', 'Callum', 'Calum', 'Calvin', 'Cam', 'Camden', 'Cameron', 'Campbell', 'Camron', 'Carey', 'Carl', 'Carlisle', 'Carlos', 'Carlton', 'Carsen', 'Carson', 'Carter', 'Cary', 'Casey', 'Cash', 'Cason', 'Casper', 'Cassius', 'Castiel', 'Castor', 'Cathal', 'Cato', 'Cavan', 'Cayden', 'Caydon', 'Cecil', 'Cedric', 'Cesar', 'Chad', 'Chance', 'Chandler', 'Channing', 'Charles', 'Charley', 'Charlie', 'Charlton', 'Chase', 'Chaz', 'Che', 'Chesney', 'Chester', 'Chevy', 'Chip', 'Chris', 'Christian', 'Christopher', 'Chuck', 'Cian', 'Ciaran', 'Cillian', 'Clancy', 'Clarence', 'Clark', 'Claude', 'Clay', 'Clayton', 'Clement', 'Cliff', 'Clifford', 'Clifton', 'Clint', 'Clinton', 'Clive', 'Clyde', 'Coby', 'Cody', 'Cohen', 'Colby', 'Cole', 'Colin', 'Collin', 'Colm', 'Colt', 'Colton', 'Conan', 'Conner', 'Connor', 'Conor', 'Conrad', 'Constantine', 'Cooper', 'Corbin', 'Corey', 'Cormac', 'Cornelius', 'Cory', 'Craig', 'Cristian', 'Cristobal', 'Crosby', 'Cruz', 'Cullen', 'Curt', 'Curtis', 'Cuthbert', 'Cyril', 'Cyrus', 'Dacey', 'Daire', 'Dakota', 'Dale', 'Dallas', 'Dalton', 'Damian', 'Damien', 'Damion', 'Damon', 'Dan', 'Dana', 'Dane', 'Daniel', 'Danny', 'Dante', 'Dara', 'Daragh', 'Darcy', 'Daren', 'Darian', 'Darin', 'Dario', 'Darius', 'Darnell', 'Darragh', 'Darrel', 'Darrell', 'Darren', 'Darrin', 'Darryl', 'Darryn', 'Darwin', 'Daryl', 'Dash', 'Dashawn', 'Dave', 'David', 'Davin', 'Davion', 'Davis', 'Dawson', 'Dax', 'Daxter', 'Daxton', 'Dayton', 'Deacon', 'Dean', 'Deandre', 'Declan', 'Deepak', 'Delbert', 'Demetrius', 'Denis', 'Dennis', 'Denver', 'Denzel', 'Deon', 'Derek', 'Dermot', 'Derrick', 'Deshaun', 'Deshawn', 'Desmond', 'Dev', 'Devin', 'Devlin', 'Devon', 'Dewayne', 'Dewey', 'Dexter', 'Diarmuid', 'Dick', 'Diego', 'Dilan', 'Dillon', 'Dimitri', 'Dinesh', 'Dino', 'Dion', 'Dirk', 'Django', 'Dmitri', 'Dominic', 'Dominick', 'Don', 'Donald', 'Donnie', 'Donovan', 'Dorian', 'Doug', 'Douglas', 'Doyle', 'Drake', 'Drew', 'Duane', 'Duke', 'Duncan', 'Dustin', 'Dwayne', 'Dwight', 'Dylan', 'Eamon', 'Earl', 'Earnest', 'Eason', 'Easton', 'Ed', 'Eddie', 'Eddy', 'Eden', 'Edgar', 'Edison', 'Edmund', 'Edouard', 'Edric', 'Edsel', 'Eduardo', 'Edward', 'Edwardo', 'Edwin', 'Efrain', 'Efren', 'Egan', 'Egon', 'Eli', 'Elias', 'Elijah', 'Eliot', 'Elisha', 'Ellington', 'Elliot', 'Elliott', 'Ellis', 'Elmer', 'Elmo', 'Elton', 'Elvis', 'Elwyn', 'Emanuel', 'Emerson', 'Emery', 'Emet', 'Emil', 'Emiliano', 'Emilio', 'Emmanuel', 'Emmerson', 'Emmet', 'Emmett', 'Ennio', 'Enoch', 'Enrique', 'Enzo', 'Eoghan', 'Eoin', 'Eric', 'Erick', 'Erik', 'Ernest', 'Ernesto', 'Ernie', 'Errol', 'Ervin', 'Erwin', 'Esteban', 'Ethan', 'Ethen', 'Etienne', 'Euan', 'Euen', 'Eugene', 'Eustace', 'Evan', 'Evangelos', 'Evelyn', 'Everett', 'Ewan', 'Ezekiel', 'Ezio', 'Ezra', 'abian', 'abio', 'aisal', 'arley', 'ebian', 'elipe', 'elix', 'ergus', 'ernand', 'ernando', 'idel', 'inbar', 'inlay', 'inley', 'inn', 'innian', 'innigan', 'ionn', 'letcher', 'loyd', 'lynn', 'ord', 'orest', 'orrest', 'oster', 'ox', 'rancesco', 'rancis', 'rancisco', 'rank', 'rankie', 'ranklin', 'ranklyn', 'raser', 'red', 'reddie', 'reddy', 'rederick', 'redrick', 'ritz', 'Gabe', 'Gabriel', 'Gael', 'Gaelan', 'Gage', 'Gale', 'Galen', 'Gannon', 'Gareth', 'Garman', 'Garrett', 'Garrison', 'Garry', 'Garth', 'Gary', 'Gaston', 'Gavin', 'Gene', 'Geoff', 'Geoffrey', 'George', 'Geraint', 'Gerald', 'Gerard', 'Gerardo', 'Germain', 'Gerry', 'Gian', 'Gibson', 'Gideon', 'Gil', 'Gilbert', 'Gilberto', 'Giles', 'Gino', 'Giorgio', 'Giovanni', 'Glen', 'Glenn', 'Glyndwr', 'Godfrey', 'Godric', 'Godwin', 'Gonzalo', 'Gordon', 'Grady', 'Graeme', 'Graham', 'Grant', 'Grayson', 'Greg', 'Gregg', 'Gregor', 'Gregory', 'Grey', 'Greyson', 'Griffin', 'Guillermo', 'Gunnar', 'Gunner', 'Gus', 'Gustav', 'Gustavo', 'Guy', 'Haden', 'Haiden', 'Hal', 'Hamish', 'Han', 'Hank', 'Hans', 'Harlan', 'Harley', 'Harold', 'Harris', 'Harrison', 'Harry', 'Harvey', 'Hassan', 'Hayden', 'Hayes', 'Heath', 'Hector', 'Hendrik', 'Hendrix', 'Henley', 'Henri', 'Henry', 'Herbert', 'Herman', 'Heston', 'Hilary', 'Holden', 'Homer', 'Horace', 'Horatio', 'Howard', 'Hubert', 'Hudson', 'Hugh', 'Hugo', 'Humberto', 'Humphrey', 'Hunter', 'Huw', 'Hywel', 'Iain', 'Ian', 'Ianto', 'Ibrahim', 'Idris', 'Ieuan', 'Iggy', 'Ignacio', 'Igor', 'Ike', 'Imran', 'Indiana', 'Inigo', 'Ira', 'Irvin', 'Irving', 'Irwin', 'Isaac', 'Isaiah', 'Isiah', 'Isidore', 'Ismael', 'Israel', 'Issac', 'Ivan', 'Ivor', 'Jace', 'Jack', 'Jackie', 'Jackson', 'Jacob', 'Jacoby', 'Jacques', 'Jaden', 'Jadon', 'Jagger', 'Jago', 'Jai', 'Jaiden', 'Jaime', 'Jak', 'Jake', 'Jakob', 'Jalen', 'Jamal', 'James', 'Jameson', 'Jamie', 'Jamison', 'Jan', 'Jared', 'Jarod', 'Jarrett', 'Jarrod', 'Jarvis', 'Jase', 'Jason', 'Jasper', 'Javier', 'Javon', 'Jax', 'Jaxon', 'Jaxson', 'Jay', 'Jayce', 'Jayden', 'Jaydon', 'Jaylen', 'Jaylin', 'Jaylon', 'Jayson', 'Jeb', 'Jebediah', 'Jed', 'Jediah', 'Jedidiah', 'Jeff', 'Jefferson', 'Jeffery', 'Jeffrey', 'Jeffry', 'Jensen', 'Jenson', 'Jerald', 'Jeremiah', 'Jeremy', 'Jericho', 'Jermaine', 'Jerome', 'Jerry', 'Jesse', 'Jessie', 'Jesus', 'Jet', 'Jethro', 'Jett', 'Jim', 'Jimmie', 'Jimmy', 'Joachim', 'Joaquin', 'Jody', 'Joe', 'Joel', 'Joey', 'Johan', 'John', 'Johnathan', 'Johnathon', 'Johnnie', 'Johnny', 'Jon', 'Jonah', 'Jonas', 'Jonathan', 'Jonathon', 'Jonty', 'Jordan', 'Jordon', 'Jordy', 'Jorge', 'Jose', 'Joseph', 'Josh', 'Joshua', 'Josiah', 'Josue', 'Jovan', 'Juan', 'Judah', 'Judas', 'Judd', 'Jude', 'Julian', 'Julio', 'Julius', 'Justice', 'Justin', 'Kade', 'Kaden', 'Kai', 'Kaiden', 'Kaine', 'Kale', 'Kaleb', 'Kameron', 'Kane', 'Karl', 'Karson', 'Kash', 'Kasper', 'Kayden', 'Kaylen', 'Kayson', 'Keanu', 'Keaton', 'Kedrick', 'Keegan', 'Keenan', 'Keith', 'Kellan', 'Kellen', 'Kellin', 'Kelly', 'Kelvin', 'Ken', 'Kendall', 'Kendrick', 'Kennedy', 'Kenneth', 'Kenny', 'Kent', 'Kenton', 'Kerry', 'Kevin', 'Khalid', 'Khalil', 'Kian', 'Kiefer', 'Kieran', 'Kieron', 'Killian', 'Kim', 'Kingsley', 'Kingston', 'Kip', 'Kiran', 'Kirby', 'Kirk', 'Kit', 'Klaus', 'Klay', 'Knox', 'Kobe', 'Koby', 'Kody', 'Kolby', 'Kris', 'Krish', 'Kristian', 'Kristoff', 'Kristopher', 'Kurt', 'Kurtis', 'Kye', 'Kylar', 'Kyle', 'Kylen', 'Kyler', 'Kyran', 'Kyrin', 'Kyron', 'Lacey', 'Lachlan', 'Lake', 'Lamar', 'Lamont', 'Lance', 'Landen', 'Landon', 'Landyn', 'Lane', 'Langdon', 'Langston', 'Larry', 'Lars', 'Laurence', 'Laurie', 'Lawrence', 'Lawson', 'Layne', 'Layton', 'Leaf', 'Leandro', 'Lebron', 'Lee', 'Leigh', 'Leighton', 'Leland', 'Lennie', 'Lennon', 'Lennox', 'Lenny', 'Leo', 'Leon', 'Leonard', 'Leonardo', 'Leonel', 'Leopold', 'Leroy', 'Les', 'Leslie', 'Lester', 'Leuan', 'Lev', 'Leven', 'Levi', 'Lewis', 'Lex', 'Liam', 'Lief', 'Lincoln', 'Link', 'Linus', 'Lionel', 'Lisandro', 'Lloyd', 'Lochlan', 'Logan', 'Loki', 'London', 'Lonnie', 'Lorcan', 'Loren', 'Lorenzo', 'Loris', 'Lou', 'Louie', 'Louis', 'Lowell', 'Luca', 'Lucas', 'Lucian', 'Luciano', 'Luigi', 'Luis', 'Lukas', 'Luke', 'Luther', 'Lyle', 'Lyndon', 'Lynn', 'Lysander', 'Mack', 'Maddox', 'Magnus', 'Maison', 'Malachi', 'Malakai', 'Malcolm', 'Malik', 'Malloy', 'Manny', 'Manuel', 'Marc', 'Marcel', 'Marco', 'Marcos', 'Marcus', 'Marik', 'Mario', 'Marion', 'Mark', 'Marley', 'Marlon', 'Marquis', 'Marshall', 'Martin', 'Marty', 'Martyn', 'Marvin', 'Mason', 'Massimo', 'Mat', 'Mateo', 'Mathew', 'Matt', 'Matthew', 'Matthias', 'Maurice', 'Mauricio', 'Maverick', 'Max', 'Maxim', 'Maximilian', 'Maximus', 'Maxwell', 'Mehdi', 'Mehtab', 'Mekhi', 'Mel', 'Melvin', 'Merick', 'Mervyn', 'Micah', 'Michael', 'Micheal', 'Mick', 'Mickey', 'Miguel', 'Mike', 'Mikey', 'Milan', 'Miles', 'Miller', 'Milo', 'Milton', 'Misha', 'Mitch', 'Mitchell', 'Mitt', 'Moe', 'Mohamed', 'Mohammad', 'Mohammed', 'Moises', 'Monte', 'Monty', 'Mordecai', 'Morgan', 'Morris', 'Moses', 'Muhammad', 'Murphy', 'Murray', 'Myles', 'Myron', 'Nash', 'Nasir', 'Nate', 'Nath', 'Nathan', 'Nathanael', 'Nathaniel', 'Neal', 'Ned', 'Nehemiah', 'Neil', 'Nelson', 'Nesbit', 'Nestor', 'Neville', 'Nevin', 'Niall', 'Nicholas', 'Nick', 'Nickolas', 'Nicky', 'Nico', 'Nicolas', 'Nigel', 'Niklaus', 'Nikolai', 'Nikolas', 'Nile', 'Nils', 'Noah', 'Noe', 'Noel', 'Nolan', 'Norbert', 'Norman', 'Oakes', 'Oakley', 'Octavio', 'Oisin', 'Olaf', 'Oli', 'Oliver', 'Ollie', 'Olly', 'Omar', 'Oran', 'Orion', 'Orlando', 'Orson', 'Oscar', 'Osvaldo', 'Oswald', 'Otis', 'Otto', 'Owen', 'Ozzie', 'Ozzy', 'Pablo', 'Paco', 'Paddy', 'Padraig', 'Palmer', 'Paolo', 'Parker', 'Pascal', 'Pat', 'Patrick', 'Paul', 'Paxton', 'Payton', 'Pearce', 'Pedro', 'Percy', 'Perry', 'Petar', 'Pete', 'Peter', 'Peyton', 'Phebian', 'Phil', 'Philip', 'Philippe', 'Phillip', 'Phineas', 'Phoenix', 'Pierce', 'Piers', 'Pip', 'Porter', 'Poul', 'Prakash', 'Preston', 'Prince', 'Princeton', 'Quentin', 'Quincy', 'Quinlan', 'Quinn', 'Quinton', 'Quintrell', 'Rafael', 'Rafferty', 'Raheem', 'Rahul', 'Raiden', 'Raj', 'Rajesh', 'Ralph', 'Ram', 'Rameel', 'Ramon', 'Ramsey', 'Randal', 'Randall', 'Randolph', 'Randy', 'Raoul', 'Raphael', 'Rashad', 'Rashan', 'Rashid', 'Raul', 'Ravi', 'Ray', 'Raylan', 'Raymond', 'Reece', 'Reed', 'Reef', 'Reese', 'Reggie', 'Reginald', 'Rehan', 'Reid', 'Reilly', 'Remco', 'Remington', 'Remy', 'Ren', 'Rene', 'Reuben', 'Rex', 'Reynaldo', 'Reza', 'Rhett', 'Rhys', 'Rian', 'Ricardo', 'Rich', 'Richard', 'Richie', 'Rick', 'Rickey', 'Rickie', 'Ricky', 'Rico', 'Rider', 'Rik', 'Riker', 'Riley', 'Rio', 'River', 'Roan', 'Rob', 'Robbie', 'Robby', 'Robert', 'Roberto', 'Robin', 'Rocco', 'Rock', 'Rocky', 'Rod', 'Roderick', 'Rodger', 'Rodney', 'Rodolfo', 'Rodrigo', 'Rogelio', 'Roger', 'Rohan', 'Roland', 'Rolando', 'Roman', 'Romeo', 'Ron', 'Ronald', 'Ronan', 'Ronnie', 'Ronny', 'Roosevelt', 'Rory', 'Roscoe', 'Ross', 'Rowan', 'Roy', 'Royce', 'Ruairi', 'Ruben', 'Rubin', 'Rudolph', 'Rudy', 'Rufus', 'Rupert', 'Russ', 'Russell', 'Rusty', 'Ryan', 'Ryder', 'Ryker', 'Rylan', 'Ryland', 'Ryley', 'Sacha', 'Said', 'Salvador', 'Salvatore', 'Sam', 'Samir', 'Sammy', 'Samson', 'Samuel', 'Sandeep', 'Sandy', 'Sanjay', 'Santiago', 'Sasha', 'Saul', 'Sawyer', 'Scot', 'Scott', 'Scottie', 'Scotty', 'Seamus', 'Sean', 'Seb', 'Sebastian', 'Sebastien', 'Sebestian', 'Sergio', 'Seth', 'Shadrach', 'Shane', 'Shannon', 'Shaun', 'Shawn', 'Shay', 'Shayne', 'Shea', 'Sheldon', 'Shelton', 'Sherlock', 'Sherman', 'Shiloh', 'Sid', 'Sidney', 'Silas', 'Simeon', 'Simon', 'Sky', 'Skylar', 'Skyler', 'Slade', 'Sol', 'Solomon', 'Sonny', 'Soren', 'Spencer', 'Spike', 'Stacey', 'Stacy', 'Stan', 'Stanley', 'Stefan', 'Stephan', 'Stephen', 'Sterling', 'Steve', 'Steven', 'Stevie', 'Stewart', 'Stone', 'Storm', 'Stuart', 'Sufyan', 'Sullivan', 'Sven', 'Sylvester', 'Tadhg', 'Talon', 'Tam', 'Tanner', 'Tariq', 'Tarquin', 'Tate', 'Taylor', 'Ted', 'Teddy', 'Teo', 'Terence', 'Terrance', 'Terrell', 'Terrence', 'Terry', 'Tevin', 'Tex', 'Thad', 'Thaddeus', 'Theo', 'Theodore', 'Theophilus', 'Thomas', 'Thor', 'Tiago', 'Tiberius', 'Tiger', 'Tim', 'Timmy', 'Timothy', 'Tito', 'Titus', 'Tobias', 'Tobin', 'Toby', 'Tod', 'Todd', 'Tom', 'Tomas', 'Tommie', 'Tommy', 'Tony', 'Torin', 'Toryn', 'Trace', 'Tracey', 'Tracy', 'Travis', 'Tray', 'Tremaine', 'Trent', 'Trenton', 'Trevon', 'Trevor', 'Trey', 'Tristan', 'Tristen', 'Triston', 'Troy', 'Truman', 'Tucker', 'Ty', 'Tyler', 'Tyrese', 'Tyrone', 'Tyson', 'Ulysses', 'Umar', 'Uriah', 'Uriel', 'Usama', 'Valentin', 'Valentine', 'Valentino', 'Van', 'Vance', 'Vasco', 'Vaughn', 'Vernon', 'Victor', 'Vihan', 'Vijay', 'Vikram', 'Vince', 'Vincent', 'Vinnie', 'Virgil', 'Vishal', 'Vivian', 'Vlad', 'Vladimir', 'Wade', 'Walker', 'Wallace', 'Walter', 'Warren', 'Waylon', 'Wayne', 'Wendell', 'Wes', 'Wesley', 'Weston', 'Wilbert', 'Wilbur', 'Wiley', 'Wilfred', 'Wilhelm', 'Will', 'Willam', 'Willard', 'Willem', 'William', 'Willie', 'Willis', 'Wilson', 'Winston', 'Wolfgang', 'Woody', 'Wyatt', 'Xander', 'Xavier', 'Xerxes', 'Yahir', 'Yardley', 'Yehudi', 'Yestin', 'York', 'Yuri', 'Yusuf', 'Yves', 'Zac', 'Zach', 'Zachariah', 'Zachary', 'Zachery', 'Zack', 'Zackary', 'Zackery', 'Zaiden', 'Zain', 'Zaine', 'Zak', 'Zander', 'Zane', 'Zayden', 'Zayn', 'Zayne', 'Zeb', 'Zebulon', 'Zed', 'Zeke', 'Zeph', 'Ziggy', 'Zion', 'Zoltan', 'Zuriel', 'Zylen'], ['Aaliyah', 'Aarushi', 'Abagail', 'Abbey', 'Abbi', 'Abbie', 'Abby', 'Abi', 'Abia', 'Abigail', 'Abrianna', 'Abrielle', 'Aby', 'Acacia', 'Ada', 'Adalia', 'Adalyn', 'Addie', 'Addison', 'Adelaide', 'Adele', 'Adelene', 'Adelia', 'Adelina', 'Adeline', 'Adreanna', 'Adriana', 'Adrianna', 'Adrianne', 'Adrienne', 'Aerona', 'Agatha', 'Aggie', 'Agnes', 'Aida', 'Aileen', 'Ailsa', 'Aimee', 'Aine', 'Ainsleigh', 'Ainsley', 'Aisha', 'Aisling', 'Aislinn', 'Alaina', 'Alana', 'Alanis', 'Alanna', 'Alannah', 'Alaska', 'Alayah', 'Alayna', 'Alba', 'Alberta', 'Aleah', 'Alecia', 'Aleisha', 'Alejandra', 'Alena', 'Alessandra', 'Alessia', 'Alex', 'Alexa', 'Alexandra', 'Alexandria', 'Alexia', 'Alexis', 'Alexus', 'Ali', 'Alia', 'Alice', 'Alicia', 'Alina', 'Alisa', 'Alisha', 'Alison', 'Alissa', 'Alivia', 'Aliyah', 'Aliza', 'Alize', 'Alka', 'Allie', 'Allison', 'Ally', 'Allyson', 'Alma', 'Alondra', 'Alycia', 'Alyshialynn', 'Alyson', 'Alyssa', 'Alyssia', 'Amalia', 'Amanda', 'Amani', 'Amara', 'Amari', 'Amaris', 'Amaya', 'Amber', 'Amberly', 'Amelia', 'Amelie', 'America', 'Amethyst', 'Amie', 'Amina', 'Amirah', 'Amity', 'Amy', 'Amya', 'Ana', 'Anabel', 'Anabelle', 'Anahi', 'Anais', 'Anamaria', 'Ananya', 'Anastasia', 'Andie', 'Andrea', 'Andromeda', 'Angel', 'Angela', 'Angelia', 'Angelica', 'Angelina', 'Angeline', 'Angelique', 'Angie', 'Anika', 'Anisa', 'Anita', 'Aniya', 'Aniyah', 'Anjali', 'Ann', 'Anna', 'Annabel', 'Annabella', 'Annabelle', 'Annabeth', 'Annalisa', 'Annalise', 'Anne', 'Anneke', 'Annemarie', 'Annette', 'Annie', 'Annika', 'Annmarie', 'Anthea', 'Antoinette', 'Antonia', 'Anuja', 'Anusha', 'Anushka', 'Anya', 'Aoibhe', 'Aoibheann', 'Aoife', 'Aphrodite', 'Apple', 'April', 'Aqua', 'Arabella', 'Arabelle', 'Aria', 'Ariadne', 'Ariana', 'Arianna', 'Arianne', 'Ariel', 'Ariella', 'Arielle', 'Arisha', 'Arleen', 'Arlene', 'Arlette', 'Artemis', 'Arwen', 'Arya', 'Asha', 'Ashanti', 'Ashlee', 'Ashleigh', 'Ashley', 'Ashlie', 'Ashlyn', 'Ashlynn', 'Ashton', 'Ashvini', 'Asia', 'Asma', 'Aspen', 'Astrid', 'Athena', 'Athene', 'Aubreanna', 'Aubree', 'Aubrey', 'Audra', 'Audrey', 'Audrina', 'Augustina', 'Aurelia', 'Aurora', 'Autumn', 'Ava', 'Avalon', 'Avery', 'Avril', 'Aya', 'Ayana', 'Ayanna', 'Ayesha', 'Ayisha', 'Ayla', 'Azalea', 'Azaria', 'Azariah', 'Bailey', 'Barbara', 'Barbie', 'Bay', 'Baylee', 'Bea', 'Beatrice', 'Beatrix', 'Becca', 'Beccy', 'Becky', 'Belinda', 'Bella', 'Bellatrix', 'Belle', 'Benita', 'Bernadette', 'Bernice', 'Bertha', 'Beryl', 'Bess', 'Beth', 'Bethan', 'Bethanie', 'Bethany', 'Betsy', 'Bettina', 'Betty', 'Beverly', 'Beyonce', 'Bianca', 'Billie', 'Blair', 'Blaire', 'Blake', 'Blakely', 'Blanche', 'Blaze', 'Blessing', 'Bliss', 'Bloom', 'Blossom', 'Blythe', 'Bobbi', 'Bobbie', 'Bobby', 'Bonita', 'Bonnie', 'Bonquesha', 'Braelyn', 'Brandi', 'Brandy', 'Braylee', 'Brea', 'Breanna', 'Bree', 'Breeze', 'Brenda', 'Brenna', 'Bria', 'Briana', 'Brianna', 'Brianne', 'Briar', 'Bridget', 'Bridgette', 'Bridie', 'Briella', 'Brielle', 'Brigid', 'Briley', 'Brinley', 'Briony', 'Brisa', 'Bristol', 'Britney', 'Britt', 'Brittany', 'Brittney', 'Brogan', 'Bronagh', 'Bronte', 'Bronwen', 'Bronwyn', 'Brook', 'Brooke', 'Brooklyn', 'Brooklynn', 'Bryanna', 'Brylee', 'Bryn', 'Brynlee', 'Brynn', 'Bryony', 'Bunty', 'Cadence', 'Cailin', 'Caitlan', 'Caitlin', 'Caitlyn', 'Caleigh', 'Cali', 'Calista', 'Callie', 'Calliope', 'Callista', 'Calypso', 'Cambria', 'Cameron', 'Cami', 'Camila', 'Camilla', 'Camille', 'Camryn', 'Candace', 'Candice', 'Candis', 'Candy', 'Caoimhe', 'Caprice', 'Cara', 'Carina', 'Caris', 'Carissa', 'Carla', 'Carlene', 'Carley', 'Carlie', 'Carly', 'Carlynn', 'Carmel', 'Carmela', 'Carmen', 'Carol', 'Carole', 'Carolina', 'Caroline', 'Carolyn', 'Carrie', 'Carter', 'Carys', 'Casey', 'Cassandra', 'Cassia', 'Cassidy', 'Cassie', 'Cat', 'Catalina', 'Cate', 'Caterina', 'Cathalina', 'Catherine', 'Cathleen', 'Cathy', 'Catlin', 'Catrina', 'Catriona', 'Cayla', 'Cece', 'Cecelia', 'Cecilia', 'Cecily', 'Celeste', 'Celestia', 'Celestine', 'Celia', 'Celina', 'Celine', 'Celise', 'Cerise', 'Cerys', 'Chanel', 'Chanelle', 'Chantal', 'Chantelle', 'Charis', 'Charissa', 'Charity', 'Charlene', 'Charley', 'Charlie', 'Charlize', 'Charlotte', 'Charmaine', 'Chastity', 'Chelsea', 'Chelsey', 'Chenai', 'Chenille', 'Cher', 'Cheri', 'Cherie', 'Cherry', 'Cheryl', 'Cheyanne', 'Cheyenne', 'Chiara', 'Chloe', 'Chris', 'Chrissy', 'Christa', 'Christabel', 'Christal', 'Christen', 'Christi', 'Christiana', 'Christie', 'Christina', 'Christine', 'Christy', 'Chrystal', 'Ciara', 'Cici', 'Ciel', 'Cierra', 'Cindy', 'Claire', 'Clara', 'Clarabelle', 'Clare', 'Clarice', 'Claris', 'Clarissa', 'Clarisse', 'Clarity', 'Clary', 'Claudette', 'Claudia', 'Claudine', 'Clea', 'Clementine', 'Cleo', 'Cleopatra', 'Clodagh', 'Clotilde', 'Clover', 'Coco', 'Colette', 'Colleen', 'Connie', 'Constance', 'Cora', 'Coral', 'Coralie', 'Coraline', 'Cordelia', 'Cori', 'Corina', 'Corinne', 'Cornelia', 'Corra', 'Cosette', 'Courtney', 'Cressida', 'Cristal', 'Cristina', 'Crystal', 'Cyndi', 'Cynthia', 'Dagmar', 'Dahlia', 'Daisy', 'Dakota', 'Dana', 'Danette', 'Dani', 'Danica', 'Daniela', 'Daniella', 'Danielle', 'Danika', 'Daphne', 'Dara', 'Darby', 'Darcey', 'Darcie', 'Darcy', 'Daria', 'Darla', 'Darlene', 'Dasia', 'Davida', 'Davina', 'Dawn', 'Dayna', 'Daysha', 'Deana', 'Deandra', 'Deann', 'Deanna', 'Deanne', 'Deb', 'Debbie', 'Debby', 'Debora', 'Deborah', 'Debra', 'Dee', 'Deedee', 'Deena', 'Deidre', 'Deirdre', 'Deja', 'Delaney', 'Delanie', 'Delany', 'Delia', 'Delilah', 'Della', 'Delores', 'Delphine', 'Demetria', 'Demi', 'Dena', 'Denise', 'Denny', 'Desiree', 'Destinee', 'Destiny', 'Diamond', 'Diana', 'Diane', 'Dianna', 'Dianne', 'Dido', 'Dina', 'Dionne', 'Dior', 'Dixie', 'Dolly', 'Dolores', 'Dominique', 'Donna', 'Dora', 'Doreen', 'Doris', 'Dorothy', 'Dot', 'Drew', 'Dulce', 'Eabha', 'Ebony', 'Echo', 'Eden', 'Edie', 'Edith', 'Edna', 'Edwina', 'Effie', 'Eileen', 'Eilidh', 'Eimear', 'Elaina', 'Elaine', 'Elana', 'Eleanor', 'Electra', 'Elektra', 'Elena', 'Eliana', 'Elin', 'Elina', 'Elinor', 'Elisa', 'Elisabeth', 'Elise', 'Eliza', 'Elizabeth', 'Ella', 'Elle', 'Ellen', 'Ellery', 'Ellie', 'Ellis', 'Elly', 'Elodie', 'Eloise', 'Elora', 'Elsa', 'Elsie', 'Elspeth', 'Elva', 'Elvira', 'Elysia', 'Elyza', 'Emanuela', 'Ember', 'Emelda', 'Emely', 'Emer', 'Emerald', 'Emerson', 'Emilee', 'Emilia', 'Emilie', 'Emily', 'Emma', 'Emmalee', 'Emmaline', 'Emmalyn', 'Emmanuelle', 'Emmeline', 'Emmie', 'Emmy', 'Enid', 'Enya', 'Erica', 'Erika', 'Erin', 'Eris', 'Eryn', 'Esmay', 'Esme', 'Esmeralda', 'Esparanza', 'Esperanza', 'Estee', 'Estelle', 'Ester', 'Esther', 'Estrella', 'Ethel', 'Eugenie', 'Eunice', 'Eva', 'Evangelina', 'Evangeline', 'Eve', 'Evelin', 'Evelyn', 'Everly', 'Evie', 'Evita', 'Fabrizia', 'Faith', 'Fallon', 'Fanny', 'Farah', 'Farrah', 'Fatima', 'Fawn', 'Fay', 'Faye', 'Felicia', 'Felicity', 'Fern', 'Fernanda', 'Ffion', 'Fifi', 'Fiona', 'Fleur', 'Flick', 'Flo', 'Flora', 'Florence', 'Fran', 'Frances', 'Francesca', 'Francine', 'Frankie', 'Freda', 'Freya', 'Frida', 'Gabby', 'Gabriela', 'Gabriella', 'Gabrielle', 'Gail', 'Garnet', 'Gayle', 'Gaynor', 'Geena', 'Gemma', 'Gena', 'Genesis', 'Genevieve', 'Georgette', 'Georgia', 'Georgie', 'Georgina', 'Geraldine', 'Gert', 'Gertrude', 'Gia', 'Gianna', 'Gigi', 'Gillian', 'Gina', 'Ginger', 'Ginny', 'Giovanna', 'Gisela', 'Giselle', 'Gisselle', 'Gladys', 'Glenda', 'Glenys', 'Gloria', 'Glynis', 'Golda', 'Goldie', 'Grace', 'Gracelyn', 'Gracie', 'Grainne', 'Greta', 'Gretchen', 'Griselda', 'Guadalupe', 'Guinevere', 'Gwen', 'Gwendolyn', 'Gwyneth', 'Habiba', 'Hadley', 'Hailee', 'Hailey', 'Haleigh', 'Haley', 'Halle', 'Hallie', 'Hanna', 'Hannah', 'Harley', 'Harmony', 'Harper', 'Harriet', 'Hattie', 'Haven', 'Hayden', 'Haylee', 'Hayley', 'Hazel', 'Hazeline', 'Heather', 'Heaven', 'Heidi', 'Helen', 'Helena', 'Helene', 'Helga', 'Helina', 'Henrietta', 'Hepsiba', 'Hera', 'Hermione', 'Hester', 'Hetty', 'Hilary', 'Hilda', 'Hillary', 'Hollie', 'Holly', 'Honesty', 'Honey', 'Honor', 'Honour', 'Hope', 'Hyacinth', 'Ianthe', 'Ida', 'Ila', 'Ilene', 'Iliana', 'Ilona', 'Ilse', 'Imani', 'Imelda', 'Imogen', 'India', 'Indie', 'Indigo', 'Indira', 'Ines', 'Ingrid', 'Iona', 'Ira', 'Irene', 'Irina', 'Iris', 'Irma', 'Isa', 'Isabel', 'Isabell', 'Isabella', 'Isabelle', 'Isadora', 'Isha', 'Isis', 'Isla', 'Isobel', 'Isolde', 'Itzel', 'Ivana', 'Ivy', 'Iyanna', 'Izabella', 'Izidora', 'Izzie', 'Izzy', 'Jacinda', 'Jacinta', 'Jackie', 'Jacqueline', 'Jacquelyn', 'Jada', 'Jade', 'Jaden', 'Jadyn', 'Jaelynn', 'Jaida', 'Jaime', 'Jamie', 'Jamiya', 'Jan', 'Jana', 'Jancis', 'Jane', 'Janelle', 'Janessa', 'Janet', 'Janette', 'Jania', 'Janice', 'Janie', 'Janine', 'Janis', 'Janiya', 'January', 'Jaqueline', 'Jasmin', 'Jasmine', 'Jaya', 'Jayda', 'Jayden', 'Jayla', 'Jaylene', 'Jaylinn', 'Jaylynn', 'Jayne', 'Jazlyn', 'Jazmin', 'Jazmine', 'Jazz', 'Jean', 'Jeanette', 'Jeanine', 'Jeanne', 'Jeannette', 'Jeannie', 'Jeannine', 'Jemima', 'Jemma', 'Jen', 'Jena', 'Jenelle', 'Jenessa', 'Jenna', 'Jennette', 'Jenni', 'Jennie', 'Jennifer', 'Jenny', 'Jensen', 'Jeri', 'Jerri', 'Jess', 'Jessa', 'Jessica', 'Jessie', 'Jet', 'Jewel', 'Jill', 'Jillian', 'Jo', 'Joan', 'Joann', 'Joanna', 'Joanne', 'Jocelyn', 'Jodi', 'Jodie', 'Jody', 'Joelle', 'Johanna', 'Joleen', 'Jolene', 'Jolie', 'Joni', 'Jordan', 'Jordana', 'Jordyn', 'Jorja', 'Joselyn', 'Josephine', 'Josie', 'Joy', 'Joyce', 'Juanita', 'Jude', 'Judith', 'Judy', 'Jules', 'Julia', 'Juliana', 'Julianna', 'Julianne', 'Julie', 'Julienne', 'Juliet', 'Juliette', 'Julissa', 'July', 'June', 'Juniper', 'Juno', 'Justice', 'Justina', 'Justine', 'Kacey', 'Kadence', 'Kaidence', 'Kailey', 'Kailyn', 'Kaitlin', 'Kaitlyn', 'Kaitlynn', 'Kalea', 'Kaleigh', 'Kali', 'Kalia', 'Kalista', 'Kallie', 'Kamala', 'Kamryn', 'Kara', 'Karen', 'Kari', 'Karin', 'Karina', 'Karissa', 'Karla', 'Karlee', 'Karly', 'Karolina', 'Karyn', 'Kasey', 'Kassandra', 'Kassidy', 'Kassie', 'Kat', 'Katara', 'Katarina', 'Kate', 'Katelyn', 'Katelynn', 'Katerina', 'Katharine', 'Katherine', 'Kathleen', 'Kathryn', 'Kathy', 'Katia', 'Katie', 'Katlyn', 'Katniss', 'Katrina', 'Katy', 'Katya', 'Kay', 'Kaya', 'Kaye', 'Kayla', 'Kaylee', 'Kayleigh', 'Kayley', 'Kaylie', 'Kaylin', 'Keara', 'Keeley', 'Keely', 'Keira', 'Keisha', 'Kelis', 'Kelley', 'Kelli', 'Kellie', 'Kelly', 'Kelsey', 'Kelsie', 'Kendall', 'Kendra', 'Kenna', 'Kennedy', 'Kenzie', 'Kera', 'Keri', 'Kerian', 'Kerri', 'Kerry', 'Kia', 'Kiana', 'Kiara', 'Kiera', 'Kierra', 'Kiersten', 'Kiki', 'Kiley', 'Kim', 'Kimberlee', 'Kimberley', 'Kimberly', 'Kimbriella', 'Kimmy', 'Kinley', 'Kinsey', 'Kinsley', 'Kira', 'Kirsten', 'Kirstin', 'Kirsty', 'Kitty', 'Kizzy', 'Kloe', 'Kora', 'Kori', 'Kourtney', 'Kris', 'Krista', 'Kristen', 'Kristi', 'Kristie', 'Kristin', 'Kristina', 'Kristine', 'Kristy', 'Krystal', 'Kyla', 'Kylee', 'Kyleigh', 'Kylie', 'Kyra', 'Lacey', 'Lacie', 'Lacy', 'Ladonna', 'Laila', 'Lainey', 'Lakyn', 'Lala', 'Lana', 'Laney', 'Lara', 'Larissa', 'Latoya', 'Laura', 'Laurel', 'Lauren', 'Laurie', 'Lauryn', 'Lavana', 'Lavender', 'Lavinia', 'Layla', 'Lea', 'Leah', 'Leandra', 'Leann', 'Leanna', 'Leanne', 'Lee', 'Leela', 'Leena', 'Leia', 'Leigh', 'Leila', 'Leilani', 'Lela', 'Lena', 'Lenore', 'Leona', 'Leonie', 'Leora', 'Lesley', 'Leslie', 'Lesly', 'Leticia', 'Letitia', 'Lettie', 'Lexi', 'Lexia', 'Lexie', 'Lexis', 'Leyla', 'Lia', 'Liana', 'Lianne', 'Libbie', 'Libby', 'Liberty', 'Lidia', 'Liesl', 'Lila', 'Lilac', 'Lilah', 'Lili', 'Lilian', 'Liliana', 'Lilita', 'Lilith', 'Lillia', 'Lillian', 'Lillie', 'Lilly', 'Lily', 'Lina', 'Linda', 'Lindsay', 'Lindsey', 'Lindy', 'Lisa', 'Lisette', 'Liv', 'Livia', 'Livvy', 'Liz', 'Liza', 'Lizbeth', 'Lizette', 'Lizzie', 'Lizzy', 'Logan', 'Lois', 'Lola', 'Lolita', 'London', 'Lora', 'Loran', 'Lorelei', 'Loren', 'Lorena', 'Loretta', 'Lori', 'Lorie', 'Lorna', 'Lorraine', 'Lorri', 'Lorrie', 'Lottie', 'Lotus', 'Lou', 'Louella', 'Louisa', 'Louise', 'Luann', 'Lucia', 'Luciana', 'Lucie', 'Lucille', 'Lucinda', 'Lucky', 'Lucy', 'Luisa', 'Lulu', 'Luna', 'Lupita', 'Luz', 'Lydia', 'Lyla', 'Lynda', 'Lyndsey', 'Lynette', 'Lynn', 'Lynne', 'Lynnette', 'Lynsey', 'Lyra', 'Lyric', 'Mabel', 'Macey', 'Macie', 'Mackenzie', 'Macy', 'Madalyn', 'Maddie', 'Maddison', 'Maddy', 'Madeleine', 'Madeline', 'Madelyn', 'Madison', 'Madisyn', 'Madonna', 'Madyson', 'Mae', 'Maeve', 'Magda', 'Magdalena', 'Magdalene', 'Maggie', 'Maia', 'Maire', 'Mairead', 'Maisie', 'Maisy', 'Maja', 'Makayla', 'Makenna', 'Makenzie', 'Malia', 'Malina', 'Malinda', 'Mallory', 'Malory', 'Mandy', 'Manuela', 'Mara', 'Marcela', 'Marcella', 'Marcelle', 'Marci', 'Marcia', 'Marcie', 'Marcy', 'Margaret', 'Margarita', 'Margaux', 'Marge', 'Margie', 'Margo', 'Margot', 'Margret', 'Maria', 'Mariah', 'Mariam', 'Marian', 'Mariana', 'Marianna', 'Marianne', 'Maribel', 'Marie', 'Mariela', 'Mariella', 'Marilyn', 'Marina', 'Marion', 'Marisa', 'Marisol', 'Marissa', 'Maritza', 'Marjorie', 'Marla', 'Marlee', 'Marlena', 'Marlene', 'Marley', 'Marnie', 'Marsha', 'Martha', 'Martina', 'Mary', 'Maryam', 'Maryann', 'Marybeth', 'Masie', 'Matilda', 'Maude', 'Maura', 'Maureen', 'Mavis', 'Maxine', 'May', 'Maya', 'Mazie', 'Mckayla', 'Mckenna', 'Mckenzie', 'Mea', 'Meadow', 'Meagan', 'Meera', 'Meg', 'Megan', 'Meghan', 'Mei', 'Mel', 'Melanie', 'Melina', 'Melinda', 'Melissa', 'Melody', 'Mercedes', 'Mercy', 'Meredith', 'Merida', 'Meryl', 'Mia', 'Michaela', 'Michele', 'Michelle', 'Mika', 'Mikaela', 'Mikayla', 'Mikhaela', 'Mila', 'Mildred', 'Milena', 'Miley', 'Millicent', 'Millie', 'Milly', 'Mimi', 'Mina', 'Mindy', 'Minerva', 'Minnie', 'Mira', 'Mirabel', 'Mirabelle', 'Miracle', 'Miranda', 'Miriam', 'Mirielle', 'Missie', 'Misty', 'Mitzi', 'Moira', 'Mollie', 'Molly', 'Mona', 'Monica', 'Monika', 'Monique', 'Montana', 'Montserrat', 'Morgan', 'Morgana', 'Moya', 'Muriel', 'Mya', 'Myfanwy', 'Myla', 'Myra', 'Myrna', 'Myrtle', 'Nadene', 'Nadia', 'Nadine', 'Naja', 'Nala', 'Nana', 'Nancy', 'Nanette', 'Naomi', 'Natalia', 'Natalie', 'Natasha', 'Naya', 'Nayeli', 'Nell', 'Nellie', 'Nelly', 'Nena', 'Nerissa', 'Nessa', 'Nevaeh', 'Neve', 'Nia', 'Niamh', 'Nichola', 'Nichole', 'Nicki', 'Nicky', 'Nicola', 'Nicole', 'Nicolette', 'Nieve', 'Niki', 'Nikita', 'Nikki', 'Nila', 'Nina', 'Nishka', 'Noelle', 'Noemi', 'Nola', 'Nora', 'Norah', 'Noreen', 'Norma', 'Nova', 'Nyla', 'Oasis', 'Ocean', 'Octavia', 'Odalis', 'Odalys', 'Odele', 'Odelia', 'Odette', 'Olga', 'Olive', 'Olivia', 'Oona', 'Oonagh', 'Opal', 'Ophelia', 'Oprah', 'Oriana', 'Orianna', 'Orla', 'Orlaith', 'Page', 'Paige', 'Paisley', 'Paloma', 'Pam', 'Pamela', 'Pandora', 'Pansy', 'Paola', 'Paris', 'Patience', 'Patrice', 'Patricia', 'Patsy', 'Patti', 'Patty', 'Paula', 'Paulette', 'Paulina', 'Pauline', 'Payton', 'Peace', 'Pearl', 'Peggy', 'Penelope', 'Penny', 'Perla', 'Perrie', 'Persephone', 'Petra', 'Petunia', 'Peyton', 'Phillipa', 'Philomena', 'Phoebe', 'Phoenix', 'Phyllis', 'Piper', 'Pippa', 'Pixie', 'Polly', 'Pollyanna', 'Poppy', 'Portia', 'Precious', 'Presley', 'Preslie', 'Primrose', 'Princess', 'Priscilla', 'Priya', 'Promise', 'Prudence', 'Prue', 'Queenie', 'Quiana', 'Quinn', 'Rabia', 'Rachael', 'Rachel', 'Rachelle', 'Rae', 'Raegan', 'Raelyn', 'Raina', 'Raine', 'Ramona', 'Ramsha', 'Randi', 'Rani', 'Rania', 'Raquel', 'Raven', 'Raya', 'Rayna', 'Rayne', 'Reagan', 'Reanna', 'Reanne', 'Rebecca', 'Rebekah', 'Reese', 'Regan', 'Regina', 'Reilly', 'Reina', 'Remi', 'Rena', 'Renata', 'Rene', 'Renee', 'Renesmee', 'Reyna', 'Rhea', 'Rhian', 'Rhianna', 'Rhiannon', 'Rhoda', 'Rhona', 'Rhonda', 'Ria', 'Rianna', 'Ricki', 'Rihanna', 'Rikki', 'Riley', 'Rita', 'River', 'Riya', 'Roanne', 'Roberta', 'Robin', 'Robyn', 'Rochelle', 'Rocio', 'Roisin', 'Rolanda', 'Ronda', 'Roni', 'Rosa', 'Rosalie', 'Rosalina', 'Rosalind', 'Rosalinda', 'Rosalynn', 'Rosanna', 'Rose', 'Roseanne', 'Rosella', 'Rosemarie', 'Rosemary', 'Rosetta', 'Rosie', 'Rosy', 'Rowan', 'Rowena', 'Roxana', 'Roxanne', 'Roxie', 'Roxy', 'Rozlynn', 'Ruby', 'Rue', 'Ruth', 'Ruthie', 'Ryanne', 'Rydel', 'Rylee', 'Ryleigh', 'Rylie', 'Sabina', 'Sabine', 'Sable', 'Sabrina', 'Sade', 'Sadhbh', 'Sadie', 'Saffron', 'Safire', 'Safiya', 'Sage', 'Sahara', 'Saige', 'Saira', 'Sally', 'Salma', 'Salome', 'Sam', 'Samantha', 'Samara', 'Samia', 'Samira', 'Sammie', 'Sammy', 'Sandra', 'Sandy', 'Sania', 'Saoirse', 'Sapphire', 'Sara', 'Sarah', 'Sarina', 'Sariya', 'Sascha', 'Sasha', 'Saskia', 'Savanna', 'Savannah', 'Scarlet', 'Scarlett', 'Sebastianne', 'Selah', 'Selena', 'Selene', 'Selina', 'Selma', 'Senuri', 'September', 'Seren', 'Serena', 'Serenity', 'Shakira', 'Shana', 'Shania', 'Shannon', 'Shari', 'Sharon', 'Shary', 'Shauna', 'Shawn', 'Shawna', 'Shawnette', 'Shayla', 'Shayna', 'Shea', 'Sheba', 'Sheena', 'Sheila', 'Shelby', 'Shelia', 'Shelley', 'Shelly', 'Sheri', 'Sheridan', 'Sherri', 'Sherrie', 'Sherry', 'Sheryl', 'Shirley', 'Shivani', 'Shona', 'Shonagh', 'Shreya', 'Shyla', 'Sian', 'Sidney', 'Sienna', 'Sierra', 'Sigourney', 'Silvia', 'Simone', 'Simran', 'Sinead', 'Siobhan', 'Sky', 'Skye', 'Skylar', 'Skyler', 'Sloane', 'Snow', 'Sofia', 'Sofie', 'Sondra', 'Sonia', 'Sonja', 'Sonya', 'Sophia', 'Sophie', 'Sophy', 'Sorrel', 'Spring', 'Stacey', 'Staci', 'Stacie', 'Stacy', 'Star', 'Starla', 'Stefanie', 'Stella', 'Steph', 'Stephanie', 'Sue', 'Sugar', 'Suki', 'Summer', 'Susan', 'Susanna', 'Susannah', 'Susanne', 'Susie', 'Sutton', 'Suzanna', 'Suzanne', 'Suzette', 'Suzie', 'Suzy', 'Sybil', 'Sydney', 'Sylvia', 'Sylvie', 'Tabatha', 'Tabitha', 'Tahlia', 'Tala', 'Talia', 'Talitha', 'Taliyah', 'Tallulah', 'Tamara', 'Tamera', 'Tami', 'Tamia', 'Tamika', 'Tammi', 'Tammie', 'Tammy', 'Tamra', 'Tamsin', 'Tania', 'Tanika', 'Tanisha', 'Tanya', 'Tara', 'Taryn', 'Tasha', 'Tasmin', 'Tatiana', 'Tatum', 'Tawana', 'Taya', 'Tayah', 'Tayla', 'Taylah', 'Tayler', 'Taylor', 'Teagan', 'Teegan', 'Tegan', 'Teigan', 'Tenille', 'Teresa', 'Teri', 'Terri', 'Terrie', 'Terry', 'Tess', 'Tessa', 'Thalia', 'Thea', 'Thelma', 'Theodora', 'Theresa', 'Therese', 'Thomasina', 'Tia', 'Tiana', 'Tiegan', 'Tiffany', 'Tilly', 'Tina', 'Tisha', 'Toni', 'Tonia', 'Tonya', 'Tori', 'Tracey', 'Traci', 'Tracie', 'Tracy', 'Tricia', 'Trina', 'Trinity', 'Trish', 'Trisha', 'Trista', 'Trixie', 'Trixy', 'Trudy', 'Tula', 'Tulip', 'Tyra', 'Ulrica', 'Uma', 'Una', 'Ursula', 'Valentina', 'Valeria', 'Valerie', 'Valery', 'Vanessa', 'Veda', 'Velma', 'Venetia', 'Venus', 'Vera', 'Verity', 'Veronica', 'Vicki', 'Vickie', 'Vicky', 'Victoria', 'Vienna', 'Viola', 'Violet', 'Violetta', 'Virginia', 'Vivian', 'Viviana', 'Vivien', 'Vivienne', 'Wallis', 'Wanda', 'Waverley', 'Wendi', 'Wendy', 'Whitney', 'Wilhelmina', 'Willa', 'Willow', 'Wilma', 'Winnie', 'Winnifred', 'Winona', 'Winter', 'Xandra', 'Xanthe', 'Xaviera', 'Xena', 'Xia', 'Ximena', 'Xochil', 'Xochitl', 'Yasmin', 'Yasmine', 'Yazmin', 'Yelena', 'Yesenia', 'Yolanda', 'Ysabel', 'Yulissa', 'Yvaine', 'Yvette', 'Yvonne', 'Zada', 'Zaheera', 'Zahra', 'Zaira', 'Zakia', 'Zali', 'Zara', 'Zaria', 'Zaya', 'Zayla', 'Zelda', 'Zelida', 'Zelina', 'Zena', 'Zendaya', 'Zia', 'Zina', 'Ziva', 'Zoe', 'Zoey', 'Zola', 'Zora', 'Zoya', 'Zula', 'Zuri', 'Zyana']];
  return names[gender - 1][Math.floor(Math.random() * names[gender - 1].length)];
};
/**
 * @author wangxiao
 * @date 2015-06-11
 * @homepage http://github.com/leancloud/js-analytics-sdk
 *
 * 每位工程师都有保持代码优雅的义务
 * Each engineer has a duty to keep the code elegant
 */

void function (win) {

  // 当前版本
  var VERSION = '0.0.1';

  // 获取命名空间
  var AV = win.AV || {};
  win.AV = AV;

  // AMD 加载支持
  if (typeof define === 'function' && define.amd) {
    define('AV', [], function () {
      return AV;
    });
  }

  // 命名空间，挂载一些工具方法
  var tool = {};

  // 命名空间，挂载私有方法
  var engine = {};

  var newAnalytics = function newAnalytics(options) {
    var appId = options.appId;
    var appKey = options.appKey;

    // 应用版本
    var appVersion = options.version || null;

    // 推广渠道
    var appChannel = options.channel || null;

    // 分析统计接口
    var apiHost;
    switch (options.region) {
      case 'us':
        apiHost = 'us-api.leancloud.cn';
        break;
      // 默认中国区节点
      default:
        apiHost = 'api.leancloud.cn';
        break;
    }
    var apiUrl = 'https://' + apiHost + '/1.1/stats/open/collect';

    return {

      // 发送统计数据
      send: function send(options, callback) {
        var eventsList = [];

        // 判断是否传入的是有值的数组
        if (options && options.length) {
          eventsList = options;
        }
        // 如果不是数组，那就是对象
        else {

            // 判断参数是否正确
            if (!options || !options.event) {
              throw 'EventObject must have a event value.';
            }

            // 单个事件对象
            var eventObj = {

              // 事件名称
              event: options.event,

              // 事件属性，完全自定义
              attr: options.attr,

              // 持续时长
              duration: options.duration,

              // 内部使用
              tag: options.tag
            };
            eventsList.push(eventObj);
          }

        // 处理下数据
        for (var i = 0, l = eventsList.length; i < l; i++) {
          eventsList[i].attributes = eventsList[i].attr;

          // 清理掉多余字段
          delete eventsList[i].attr;
        }

        var data = {
          client: {
            id: engine.getId(),

            // 服务器端会统一按照小写字母校验
            platform: 'web',
            app_version: appVersion,
            app_channel: appChannel
          },
          session: {
            id: tool.getId()
          },
          events: eventsList
        };

        tool.ajax({
          url: apiUrl,
          method: 'post',
          data: data,
          appId: appId,
          appKey: appKey
        }, function (result, error) {
          if (callback) {
            if (result) {
              callback(result);
            } else {
              callback(error);
            }
          }
        });
      }
    };
  };

  // 主函数
  AV.analytics = function (options) {
    if ((typeof options === "undefined" ? "undefined" : _typeof(options)) !== 'object') {
      throw 'AV.analytics need a argument at least.';
    } else if (!options.appId) {
      throw 'Options must have appId.';
    } else if (!options.appKey) {
      throw 'Options must have appKey.';
    }

    // 创建一个新的实例
    var analyticsObj = newAnalytics(options);

    // 启动自动页面时长统计
    engine.pageView(analyticsObj);

    // 启动自动 session 时长统计
    engine.sessionView(analyticsObj);

    return analyticsObj;
  };

  // 赋值版本号
  AV.analytics.version = VERSION;

  // 挂载私有方法
  AV.analytics._tool = tool;
  AV.analytics._engine = engine;

  engine.getId = function () {
    var key = 'leancloud-analytics-id';
    var id = win.localStorage.getItem(key);
    if (!id) {
      id = tool.getId();
      win.localStorage.setItem(key, id);
    }
    return id;
  };

  // 自动统计页面相关
  engine.pageView = function (analyticsObj) {
    var startTime;
    var endTime;
    var page;

    function start() {
      startTime = tool.now();
      page = win.location.href;
    }

    function end() {
      endTime = tool.now();
      analyticsObj.send({

        // 必须为 _page 表示一次页面访问
        event: '_page',

        // 页面停留时间，单位毫秒
        duration: endTime - startTime,

        // 页面名称
        tag: page
      });
    }

    // 默认自动启动
    start();

    // 监听 url 变化（包括 hash 变化）
    win.addEventListener('hashchange', function (e) {
      // 页面发生变化，发送一次页面统计
      end();
      // 再次启动新的统计
      start();
    });

    // 当页面关闭的时候
    win.addEventListener('beforeunload', function () {
      // 发送一次
      end();
    });
  };

  // 自动统计一次 session 周期的时间
  engine.sessionView = function (analyticsObj) {
    var startTime = tool.now();
    win.addEventListener('beforeunload', function () {
      var endTime = tool.now();
      analyticsObj.send({

        //必须为 _session.close 表示一次使用结束
        event: '_session.close',

        // 使用时长，单位毫秒
        duration: endTime - startTime
      });
    });
  };

  // 获取一个唯一 id
  tool.getId = function () {

    // 与时间相关的随机因子
    var getIdItem = function getIdItem() {
      return new Date().getTime().toString(36) + Math.random().toString(36).substring(2, 3);
    };
    return 'AV' + getIdItem() + getIdItem() + getIdItem();
  };

  // Ajax 请求
  tool.ajax = function (options, callback) {
    var url = options.url;
    var method = options.method || 'get';
    var xhr = new XMLHttpRequest();
    xhr.open(method, url);
    if (method === 'post' || method === 'put') {
      xhr.setRequestHeader('Content-Type', 'application/json');
    }
    if (options.appId) {
      xhr.setRequestHeader('X-AVOSCloud-Application-Id', options.appId);
    }
    if (options.appKey) {
      xhr.setRequestHeader('X-AVOSCloud-Application-Key', options.appKey);
    }
    xhr.onload = function (data) {
      // 检测认为 2xx 的返回都是成功
      if (xhr.status >= 200 && xhr.status < 300) {
        callback(JSON.parse(xhr.responseText));
      } else {
        callback(null, JSON.parse(xhr.responseText));
      }
    };
    xhr.onerror = function (data) {
      callback(null, data);
      throw 'Network error.';
    };
    xhr.send(JSON.stringify(options.data));
  };

  // 获取当前时间的时间戳
  tool.now = function () {
    return new Date().getTime();
  };
}(window);

/******/(function (modules) {
  // webpackBootstrap
  /******/ // The module cache
  /******/var installedModules = {};
  /******/
  /******/ // The require function
  /******/function __webpack_require__(moduleId) {
    /******/
    /******/ // Check if module is in cache
    /******/if (installedModules[moduleId]) {
      /******/return installedModules[moduleId].exports;
      /******/
    }
    /******/ // Create a new module (and put it into the cache)
    /******/var module = installedModules[moduleId] = {
      /******/i: moduleId,
      /******/l: false,
      /******/exports: {}
      /******/ };
    /******/
    /******/ // Execute the module function
    /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    /******/
    /******/ // Flag the module as loaded
    /******/module.l = true;
    /******/
    /******/ // Return the exports of the module
    /******/return module.exports;
    /******/
  }
  /******/
  /******/
  /******/ // expose the modules object (__webpack_modules__)
  /******/__webpack_require__.m = modules;
  /******/
  /******/ // expose the module cache
  /******/__webpack_require__.c = installedModules;
  /******/
  /******/ // define getter function for harmony exports
  /******/__webpack_require__.d = function (exports, name, getter) {
    /******/if (!__webpack_require__.o(exports, name)) {
      /******/Object.defineProperty(exports, name, {
        /******/configurable: false,
        /******/enumerable: true,
        /******/get: getter
        /******/ });
      /******/
    }
    /******/
  };
  /******/
  /******/ // getDefaultExport function for compatibility with non-harmony modules
  /******/__webpack_require__.n = function (module) {
    /******/var getter = module && module.__esModule ?
    /******/function getDefault() {
      return module['default'];
    } :
    /******/function getModuleExports() {
      return module;
    };
    /******/__webpack_require__.d(getter, 'a', getter);
    /******/return getter;
    /******/
  };
  /******/
  /******/ // Object.prototype.hasOwnProperty.call
  /******/__webpack_require__.o = function (object, property) {
    return Object.prototype.hasOwnProperty.call(object, property);
  };
  /******/
  /******/ // __webpack_public_path__
  /******/__webpack_require__.p = "/";
  /******/
  /******/ // Load entry module and return exports
  /******/return __webpack_require__(__webpack_require__.s = 9);
  /******/
})(
/************************************************************************/
/******/{

  /***/10:
  /***/function _(module, exports) {

    eval("$(function () {\n  var account = new Account();\n  account.getUserInfo(function (err, userInfo) {\n    if (!err) {\n      console.log('\u5DF2\u7ECF\u767B\u5F55');\n      console.log(userInfo);\n      window.userInfo = userInfo;\n      $('#nickname').val(userInfo.nickname || '');\n      $('#birthday').val(userInfo.birthday || '');\n      if ($('#birthday').val()) {\n        $('.age-group label[for=\"birthday\"]').text(getAge($('#birthday').val()) + '\\u5C81');\n      } else {\n        $('.age-group label[for=\"birthday\"]').text('\u8BF7\u9009\u62E9\u5B69\u5B50\u5E74\u9F84');\n      }\n      if (userInfo.gender === 2) {\n        $('.sex-group #girl').attr('checked', true);\n        $('.sex-group #boy').attr('checked', null);\n      } else {\n        $('.sex-group #boy').attr('checked', true);\n        $('.sex-group #girl').attr('checked', null);\n      }\n      if (!userInfo.isPasswordSet) {\n        // \u6CA1\u8BBE\u7F6E\u5BC6\u7801 \u5F39\u7528\u6237\u8D44\u6599\u548C\u5BC6\u7801\n        $('.survey').hide();\n        $('.class-time').hide();\n        $('.user-info').show();\n        $('.mask').show();\n      } else {\n        if (!(userInfo.nickname && userInfo.birthday)) {\n          // \u6709\u8BBE\u7F6E\u5BC6\u7801 \u4F46\u6CA1\u7528\u6237\u8D44\u6599 \u5F39\u7528\u6237\u8D44\u6599 \u4F46\u4E0D\u5F39\u5BC6\u7801\n          $('.survey').hide();\n          $('.class-time').hide();\n          $('.user-info .pwd-group').hide();\n          $('.user-info').show();\n          $('.mask').show();\n        } else {\n          if (!userInfo.timeTable) {\n            // \u6CA1\u6709\u4E0A\u8BFE\u65F6\u95F4 \u5F39\u4E0A\u8BFE\u65F6\u95F4\n            $('.survey').hide();\n            $('.user-info').hide();\n            $('.class-time').show();\n            $('.mask').show();\n          } else {\n            if (!(userInfo.survey || userInfo.level > 0)) {\n              // \u6CA1\u6709\u95EE\u5377\u8C03\u67E5 \u5F39\u95EE\u5377\u8C03\u67E5\n              $('.user-info').hide();\n              $('.class-time').hide();\n              $('.survey').show();\n              $('.mask').show();\n            }\n          }\n        }\n      }\n    } else {\n      console.log('\u6CA1\u6709\u767B\u5F55');\n    }\n  });\n\n  // \u968F\u673A\u751F\u6210nickname\n  $('.nickname-group .random').off('click').on('click', function (e) {\n    $('#nickname').val(randomName(parseInt($('input[name=\"sex\"]:checked').val())));\n  });\n\n  // \u9009\u62E9\u51FA\u751F\u65E5\u671F\u751F\u6210\u5E74\u9F84\n  $('#birthday').off('input change').on('input change', function (e) {\n    if ($('#birthday').val()) {\n      $('.age-group label[for=\"birthday\"]').text(getAge($('#birthday').val()) + '\\u5C81');\n    } else {\n      $('.age-group label[for=\"birthday\"]').text('\u8BF7\u9009\u62E9\u5B69\u5B50\u5E74\u9F84');\n    }\n  });\n\n  // \u4E0A\u8BFE\u65F6\u95F4 \u9009\u62E9\u6BCF\u54682\u8282\u6216\u80053\u8282\u8BFE\n  $('input[name=\"weeken\"]').off('input change').on('input change', function (e) {\n    var weeken = parseInt($('input[name=\"weeken\"]:checked').val());\n    console.log(weeken);\n    if (weeken === 2) {\n      $('#frequency2').show();\n      $('#frequency3').hide();\n    } else {\n      $('#frequency2').hide();\n      $('#frequency3').show();\n    }\n  });\n\n  // \u6839\u636E\u51FA\u751F\u5E74\u6708\u751F\u6210\u5E74\u9F84\n  function getAge(strBirthday) {\n    var returnAge;\n    var strBirthdayArr = strBirthday.split('-');\n    var birthYear = strBirthdayArr[0];\n    var birthMonth = strBirthdayArr[1];\n    var birthDay = strBirthdayArr[2];\n\n    var d = new Date();\n    var nowYear = d.getFullYear();\n    var nowMonth = d.getMonth() + 1;\n    var nowDay = d.getDate();\n\n    if (nowYear == birthYear) {\n      returnAge = 0; //\u540C\u5E74 \u5219\u4E3A0\u5C81\n    } else {\n      var ageDiff = nowYear - birthYear; //\u5E74\u4E4B\u5DEE\n      if (ageDiff > 0) {\n        if (nowMonth == birthMonth) {\n          var dayDiff = nowDay - birthDay; //\u65E5\u4E4B\u5DEE\n          if (dayDiff < 0) {\n            returnAge = ageDiff - 1;\n          } else {\n            returnAge = ageDiff;\n          }\n        } else {\n          var monthDiff = nowMonth - birthMonth; //\u6708\u4E4B\u5DEE\n          if (monthDiff < 0) {\n            returnAge = ageDiff - 1;\n          } else {\n            returnAge = ageDiff;\n          }\n        }\n      } else {\n        returnAge = -1; //\u8FD4\u56DE-1 \u8868\u793A\u51FA\u751F\u65E5\u671F\u8F93\u5165\u9519\u8BEF \u665A\u4E8E\u4ECA\u5929\n      }\n    }\n    return returnAge; //\u8FD4\u56DE\u5468\u5C81\u5E74\u9F84\n  }\n\n  // \u63D0\u4EA4\u7528\u6237\u8D44\u6599\n  $('#updateUserProfile').off('click').on('click', function (e) {\n    var nickname = $('#nickname').val() || '';\n    var birthday = $('#birthday').val() || '';\n    var gender = parseInt($('input[name=\"sex\"]:checked').val());\n    var password = $('#password').val() || '';\n    if (!nickname) {\n      utils.toast('\u6635\u79F0\u4E0D\u80FD\u4E3A\u7A7A');\n      return;\n    }\n    if (!birthday) {\n      utils.toast('\u751F\u65E5\u4E0D\u80FD\u4E3A\u7A7A');\n      return;\n    }\n    userInfo.nickname = nickname;\n    userInfo.birthday = birthday;\n    userInfo.gender = gender;\n    account.ajax({\n      type: 'POST',\n      path: '/s/user/',\n      data: {\n        nickname: nickname,\n        gender: gender,\n        birthday: birthday\n      },\n      success: function success(result) {\n        if (!userInfo.isPasswordSet) {\n          if (password.length >= 6 && password.length <= 12 && /^[0-9a-zA-Z]*$/.test(password)) {\n            account.ajax({\n              type: 'POST',\n              path: '/s/user/password',\n              data: { password: password },\n              success: function success(data) {\n                next();\n              },\n              error: function error(err) {\n                var error = JSON.parse(err.response);\n                console.error(error.message);\n              }\n            });\n          } else {\n            utils.toast('\u5BC6\u7801\u683C\u5F0F\u4E0D\u6B63\u786E');\n            return;\n          }\n        } else {\n          next();\n        }\n      },\n      error: function error(err) {\n        var error = JSON.parse(err.response);\n        console.error(error.message);\n      }\n    });\n\n    function next() {\n      $('.user-info').hide();\n      $('.class-time').hide();\n      $('.survey').hide();\n      $('.mask').hide();\n      if (!userInfo.timeTable) {\n        // \u6CA1\u6709\u4E0A\u8BFE\u65F6\u95F4 \u5F39\u4E0A\u8BFE\u65F6\u95F4\n        $('.survey').hide();\n        $('.user-info').hide();\n        $('.class-time').show();\n        $('.mask').show();\n      } else {\n        if (!(userInfo.survey || userInfo.level > 0)) {\n          // \u6CA1\u6709\u95EE\u5377\u8C03\u67E5 \u5F39\u95EE\u5377\u8C03\u67E5\n          $('.user-info').hide();\n          $('.class-time').hide();\n          $('.survey').show();\n          $('.mask').show();\n        }\n      }\n    }\n  });\n\n  // \u63D0\u4EA4\u4E0A\u8BFE\u65F6\u95F4\n  $('#submitClassTime').off('click').on('click', function (e) {\n    var type = parseInt($('input[name=\"weeken\"]:checked').val());\n    var time = $('input[name=\"time\"]:checked').val();\n    var frequency = {};\n    $('input[name=\"frequency' + type + '\"]:checked').val().split('_').forEach(function (f) {\n      frequency[f + '_' + time] = 1;\n    });\n    account.ajax({\n      type: 'PUT',\n      path: '/s/user/timeTable',\n      data: frequency,\n      success: function success(result) {\n        next();\n      },\n      error: function error(err) {\n        var error = JSON.parse(err.response);\n        console.error(error.message);\n      }\n    });\n\n    function next() {\n      $('.user-info').hide();\n      $('.class-time').hide();\n      $('.survey').hide();\n      $('.mask').hide();\n      if (!(userInfo.survey || userInfo.level > 0)) {\n        // \u6CA1\u6709\u95EE\u5377\u8C03\u67E5 \u5F39\u95EE\u5377\u8C03\u67E5\n        $('.user-info').hide();\n        $('.class-time').hide();\n        $('.survey').show();\n        $('.mask').show();\n      }\n    }\n  });\n\n  // \u63D0\u4EA4\u95EE\u5377\u8C03\u67E5\n  $('#submitSurvey').off('click').on('click', function (e) {\n    console.log(userInfo);\n    var answer1 = parseInt($('input[name=\"in-school\"]:checked').val());\n    var answer2 = parseInt($('input[name=\"out-school\"]:checked').val());\n    var _userInfo = userInfo,\n        nickname = _userInfo.nickname,\n        birthday = _userInfo.birthday,\n        gender = _userInfo.gender;\n\n    account.ajax({\n      type: 'POST',\n      path: '/s/surveys',\n      data: {\n        nickname: nickname,\n        birthday: birthday,\n        gender: gender,\n        answer1: answer1,\n        answer2: answer2\n      },\n      success: function success(result) {\n        console.log(result);\n        $('.user-info').hide();\n        $('.class-time').hide();\n        $('.survey').hide();\n        $('.mask').hide();\n      },\n      error: function error(err) {\n        var error = JSON.parse(err.response);\n        console.error(error.message);\n      }\n    });\n  });\n\n  setShare();\n});\n\nfunction setShare() {\n  window.wxconfig = new WxConfig(wechatConfig, '');\n  window.shareFlag = '';\n  var userInfo = JSON.parse(window.localStorage.getItem('QKidsUserInfo'));\n  if (userInfo && userInfo.shareFlag) window.shareFlag = userInfo.shareFlag;\n  if (utils.isWeChat()) wxconfig.activeShare(shareFlag, '', {\n    title: '\u3010Qkids\u4E45\u8DA3\u30114-12\u5C81\uFF0C\u5728\u5BB6\u8DDF\u5317\u7F8E\u5916\u6559\u5B66\u82F1\u8BED\uFF0C\u65B0\u7528\u6237100\u5143\u4F53\u9A8C\uFF01',\n    desc: '\u4E25\u9009\u5317\u7F8E\u5916\u6559\u5728\u7EBF\u6388\u8BFE\uFF0C\u521B\u9020\u8DA3\u5473\u5341\u8DB3\u7684\u8BFE\u5802\u4F53\u9A8C\uFF0C\u8BA9\u5B69\u5B50\u7231\u5B66\u66F4\u6709\u6548\u3002',\n    link: window.location.protocol + '//' + window.location.host + '/wx' + Math.ceil(Math.random() * 100) + '?_r=' + shareFlag,\n    imgUrl: 'https://static-app.97kid.com/site-student/public/img/share.png'\n  });\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9wdWJsaWMvbW9iaWxlL2NhbXBhaWduL3ZlcmlmeS9lczYvdmVyaWZ5LmpzPzdiZWUiXSwibmFtZXMiOlsiJCIsImFjY291bnQiLCJBY2NvdW50IiwiZ2V0VXNlckluZm8iLCJlcnIiLCJ1c2VySW5mbyIsImNvbnNvbGUiLCJsb2ciLCJ3aW5kb3ciLCJ2YWwiLCJuaWNrbmFtZSIsImJpcnRoZGF5IiwidGV4dCIsImdldEFnZSIsImdlbmRlciIsImF0dHIiLCJpc1Bhc3N3b3JkU2V0IiwiaGlkZSIsInNob3ciLCJ0aW1lVGFibGUiLCJzdX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VwICNib3knKS5hdHRyKCdjaGVja2VkJywgbnVsbClcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgICQoJy5zZXgtZ3JvdXAgI2JveScpLmF0dHIoJ2NoZWNrZWQnLCB0cnVlKVxuICAgICAgICAkKCcuc2V4LWdyb3VwICNnaXJsJykuYXR0cignY2hlY2tlZCcsIG51bGwpXG4gICAgICB9XG4gICAgICBpZiAoIXVzZXJJbmZvLmlzUGFzc3dvcmRTZXQpIHtcbiAgICAgICAgLy8g5rKh6K6+572u5a+G56CBIOW8ueeUqOaIt+i1hOaWmeWSjOWvhueggVxuICAgICAgICAkKCcuc3VydmV5JykuaGlkZSgpXG4gICAgICAgICQoJy5jbGFzcy10aW1lJykuaGlkZSgpXG4gICAgICAgICQoJy51c2VyLWluZm8nKS5zaG93KClcbiAgICAgICAgJCgnLm1hc2snKS5zaG93KClcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmICghKHVzZXJJbmZvLm5pY2tuYW1lICYmIHVzZXJJbmZvLmJpcnRoZGF5KSkge1xuICAgICAgICAgIC8vIOacieiuvue9ruWvhueggSDkvYbmsqHnlKjmiLfotYTmlpkg5by555So5oi36LWE5paZIOS9huS4jeW8ueWvhueggVxuICAgICAgICAgICQoJy5zdXJ2ZXknKS5oaWRlKClcbiAgICAgICAgICAkKCcuY2xhc3MtdGltZScpLmhpZGUoKVxuICAgICAgICAgICQoJy51c2VyLWluZm8gLnB3ZC1ncm91cCcpLmhpZGUoKVxuICAgICAgICAgICQoJy51c2VyLWluZm8nKS5zaG93KClcbiAgICAgICAgICAkKCcubWFzaycpLnNob3coKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGlmICghdXNlckluZm8udGltZVRhYmxlKSB7XG4gICAgICAgICAgICAvLyDmsqHmnInkuIror77ml7bpl7Qg5by55LiK6K++5pe26Ze0XG4gICAgICAgICAgICAkKCcuc3VydmV5JykuaGlkZSgpXG4gICAgICAgICAgICAkKCcudXNlci1pbmZvJykuaGlkZSgpXG4gICAgICAgICAgICAkKCcuY2xhc3MtdGltZScpLnNob3coKVxuICAgICAgICAgICAgJCgnLm1hc2snKS5zaG93KClcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKCEodXNlckluZm8uc3VydmV5IHx8IHVzZXJJbmZvLmxldmVsID4gMCkpIHtcbiAgICAgICAgICAgICAgLy8g5rKh5pyJ6Zeu5Y236LCD5p+lIOW8uemXruWNt+iwg+afpVxuICAgICAgICAgICAgICAkKCcudXNlci1pbmZvJykuaGlkZSgpXG4gICAgICAgICAgICAgICQoJy5jbGFzcy10aW1lJykuaGlkZSgpXG4gICAgICAgICAgICAgICQoJy5zdXJ2ZXknKS5zaG93KClcbiAgICAgICAgICAgICAgJCgnLm1hc2snKS5zaG93KClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgY29uc29sZS5sb2coJ+ayoeacieeZu+W9lScpXG4gICAgfVxuICB9KVxuXG4gIC8vIOmaj+acuueUn+aIkG5pY2tuYW1lXG4gICQoJy5uaWNrbmFtZS1ncm91cCAucmFuZG9tJykub2ZmKCdjbGljaycpLm9uKCdjbGljaycsIGUgPT4ge1xuICAgICQoJyNuaWNrbmFtZScpLnZhbChyYW5kb21OYW1lKHBhcnNlSW50KCQoYGlucHV0W25hbWU9XCJzZXhcIl06Y2hlY2tlZGApLnZhbCgpKSkpXG4gIH0pXG5cbiAgLy8g6YCJ5oup5Ye655Sf5pel5pyf55Sf5oiQ5bm06b6EXG4gICQoJyNiaXJ0aGRheScpLm9mZignaW5wdXQgY2hhbmdlJykub24oJ2lucHV0IGNoYW5nZScsIGUgPT4ge1xuICAgIGlmICgkKCcjYmlydGhkYXknKS52YWwoKSkge1xuICAgICAgJCgnLmFnZS1ncm91cCBsYWJlbFtmb3I9XCJiaXJ0aGRheVwiXScpLnRleHQoYCR7Z2V0QWdlKCQoJyNiaXJ0aGRheSc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m93WWVhciA9IGQuZ2V0RnVsbFllYXIoKVxuICAgIHZhciBub3dNb250aCA9IGQuZ2V0TW9udGgoKSArIDFcbiAgICB2YXIgbm93RGF5ID0gZC5nZXREYXRlKClcblxuICAgIGlmIChub3dZZWFyID09IGJpcnRoWWVhcikge1xuICAgICAgcmV0dXJuQWdlID0gMC8v5ZCM5bm0IOWImeS4ujDlsoFcbiAgICB9IGVsc2Uge1xuICAgICAgdmFyIGFnZURpZmYgPSBub3dZZWFyIC0gYmlydGhZZWFyIC8v5bm05LmL5beuXG4gICAgICBpZiAoYWdlRGlmZiA+IDApIHtcbiAgICAgICAgaWYgKG5vd01vbnRoID09IGJpcnRoTW9udGgpIHtcbiAgICAgICAgICB2YXIgZGF5RGlmZiA9IG5vd0RheSAtIGJpcnRoRGF5Ly/ml6XkuYvlt65cbiAgICAgICAgICBpZiAoZGF5RGlmZiA8IDApIHtcbiAgICAgICAgICAgIHJldHVybkFnZSA9IGFnZURpZmYgLSAxXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybkFnZSA9IGFnZURpZmZcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIG1vbnRoRGlmZiA9IG5vd01vbnRoIC0gYmlydGhNb250aC8v5pyI5LmL5beuXG4gICAgICAgICAgaWYgKG1vbnRoRGlmZiA8IDApIHtcbiAgICAgICAgICAgIHJldHVybkFnZSA9IGFnZURpZmYgLSAxXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybkFnZSA9IGFnZURpZmZcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybkFnZSA9IC0xLy/ov5Tlm54tMSDooajnpLrlh7rnlJ/ml6XmnJ/ovpPlhaXplJnor68g5pma5LqO5LuK5aSpXG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXR1cm5BZ2UvL+i/lOWbnuWRqOWygeW5tOm+hFxuICB9XG5cbiAgLy8g5o+Q5Lqk55So5oi36LWE5paZXG4gICQoJyN1cGRhdGVVc2VyUHJvZmlsZScpLm9mZignY2xpY2snKS5vbignY2xpY2snLCBlID0+IHtcbiAgICBjb25zdCBuaWNrbmFtZSA9ICQoJyNuaWNrbmFtZScpLnZhbCgpIHx8ICcnXG4gICAgY29uc3QgYmlydGhkYXkgPSAkKCcjYmlydGhkYXknKS52YWwoKSB8fCAnJ1xuICAgIGNvbnN0IGdlbmRlciA9IHBhcnNlSW50KCQoYGlucHV0W25hbWU9XCJzZXhcIl06Y2hlY2tlZGApLnZhbCgpKVxuICAgIGNvbnN0IHBhc3N3b3JkID0gJCgnI3Bhc3N3b3JkJykudmFsKCkgfHwgJydcbiAgICBpZiAoIW5pY2tuYW1lKSB7XG4gICAgICB1dGlscy50b2FzdCgn5pi156ew5LiN6IO95Li656m6JylcbiAgICAgIHJldHVyblxuICAgIH1cbiAgICBpZiAoIWJpcnRoZGF5KSB7XG4gICAgICB1dGlscy50b2FzdCgn55Sf5pel5LiN6IO95Li656m6JylcbiAgICAgIHJldHVyblxuICAgIH1cbiAgICB1c2VySW5mby5uaWNrbmFtZSA9IG5pY2tuYW1lXG4gICAgdXNlckluZm8uYmlydGhkYXkgPSBiaXJ0aGRheVxuICAgIHVzZXJJbmZvLmdlbmRlciA9IGdlbmRlclxuICAgIGFjY291bnQuYWpheCh7XG4gICAgICB0eXBlOiAnUE9TVCcsXG4gICAgICBwYXRoOiBgL3MvdXNlci9gLFxuICAgICAgZGF0YToge1xuICAgICAgICBuaWNrbmFtZSxcbiAgICAgICAgZ2VuZGVyLFxuICAgICAgICBiaXJ0aGRheSxcbiAgICAgIH0sXG4gICAgICBzdWNjZXNzOiByZXN1bHQgPT4ge1xuICAgICAgICBpZiAoIXVzZXJJbmZvLmlzUGFzc3dvcmRTZXQpIHtcbiAgICAgICAgICBpZiAocGFzc3dvcmQubGVuZ3RoID49IDYgJiZcbiAgICAgICAgICAgIHBhc3N3b3JkLmxlbmd0aCA8PSAxMiAmJlxuICAgICAgICAgICAgL15bMC05YS16QS1aXSokLy50ZXN0KHBhc3N3b3JkKSkge1xuICAgICAgICAgICAgYWNjb3VudC5hamF4KHtcbiAgICAgICAgICAgICAgdHlwZTogJ1BPU1QnLFxuICAgICAgICAgICAgICBwYXRoOiBgL3MvdXNlci9wYXNzd29yZGAsXG4gICAgICAgICAgICAgIGRhdGE6IHtwYXNzd29yZH0sXG4gICAgICAgICAgICAgIHN1Y2Nlc3M6IGRhdGEgPT4ge1xuICAgICAgICAgICAgICAgIG5leHQoKVxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBlcnJvcjogZXJyID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IEpTT04ucGFyc2UoZXJyLnJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IubWVzc2FnZSlcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXRpbHMudG9hc3QoJ+WvhueggeagvOW8j+S4jeato+ehricpXG4gICAgICAgICAgICByZXR1cm5cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgbmV4dCgpXG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBlcnJvcjogZXJyID0+IHtcbiAgICAgICAgY29uc3QgZXJyb3IgPSBKU09OLnBhcnNlKGVyci5yZXNwb25zZSlcbiAgICAgICAgY29uc29sZS5lcnJvcihlcnJvci5tZXNzYWdlKVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBmdW5jdGlvbiBuZXh0ICgpIHtcbiAgICAgICQoJy51c2VyLWluZm8nKS5oaWRlKClcbiAgICAgICQoJy5jbGFzcy10aW1lJykuaGlkZSgpXG4gICAgICAkKCcuc3VydmV5JykuaGlkZSgpXG4gICAgICAkKCcubWFzaycpLmhpZGUoKVxuICA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ICB9KVxuICAgIGFjY291bnQuYWpheCh7XG4gICAgICB0eXBlOiAnUFVUJyxcbiAgICAgIHBhdGg6IGAvcy91c2VyL3RpbWVUYWJsZWAsXG4gICAgICBkYXRhOiBmcmVxdWVuY3ksXG4gICAgICBzdWNjZXNzOiByZXN1bHQgPT4ge1xuICAgICAgICBuZXh0KClcbiAgICAgIH0sXG4gICAgICBlcnJvcjogZXJyID0+IHtcbiAgICAgICAgY29uc3QgZXJyb3IgPSBKU09OLnBhcnNlKGVyci5yZXNwb25zZSlcbiAgICAgICAgY29uc29sZS5lcnJvcihlcnJvci5tZXNzYWdlKVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBmdW5jdGlvbiBuZXh0ICgpIHtcbiAgICAgICQoJy51c2VyLWluZm8nKS5oaWRlKClcbiAgICAgICQoJy5jbGFzcy10aW1lJykuaGlkZSgpXG4gICAgICAkKCcuc3VydmV5JykuaGlkZSgpXG4gICAgICAkKCcubWFzaycpLmhpZGUoKVxuICAgICAgaWYgKCEodXNlckluZm8uc3VydmV5IHx8IHVzZXJJbmZvLmxldmVsID4gMCkpIHtcbiAgICAgICAgLy8g5rKh5pyJ6Zeu5Y236LCD5p+lIOW8uemXruWNt+iwg+afpVxuICAgICAgICAkKCcudXNlci1pbmZvJykuaGlkZSgpXG4gICAgICAgICQoJy5jbGFzcy10aW1lJykuaGlkZSgpXG4gICAgICAgICQoJy5zdXJ2ZXknKS5zaG93KClcbiAgICAgICAgJCgnLm1hc2snKS5zaG93KClcbiAgICAgIH1cbiAgICB9XG4gIH0pXG5cbiAgLy8g5o+Q5Lqk6Zeu5Y236LCD5p+lXG4gICQoJyNzdWJtaXRTdXJ2ZXknKS5vZmYoJ2NsaWNrJykub24oJ2NsaWNrJywgZSA9PiB7XG4gICAgY29uc29sZS5sb2codXNlckluZm8pXG4gICAgY29uc3QgYW5zd2VyMSA9IHBhcnNlSW50KCQoYGlucHV0W25hbWU9XCJpbi1zY2hvb2xcIl06Y2hlY2tlZGApLnZ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W5mbycpKVxuICBpZiAodXNlckluZm8gJiYgdXNlckluZm8uc2hhcmVGbGFnKSB3aW5kb3cuc2hhcmVGbGFnID0gdXNlckluZm8uc2hhcmVGbGFnXG4gIGlmICh1dGlscy5pc1dlQ2hhdCgpKSB3eGNvbmZpZy5hY3RpdmVTaGFyZShzaGFyZUZsYWcsICcnLCB7XG4gICAgdGl0bGU6ICfjgJBRa2lkc+S5hei2o+OAkTQtMTLlsoHvvIzlnKjlrrbot5/ljJfnvo7lpJbmlZnlraboi7Hor63vvIzmlrDnlKjmiLcxMDDlhYPkvZPpqozvvIEnLFxuICAgIGRlc2M6ICfkuKXpgInljJfnvo7lpJbmlZnlnKjnur/mjojor77vvIzliJvpgKDotqPlkbPljYHotrPnmoTor77loILkvZPpqozvvIzorqnlranlrZDniLHlrabmm7TmnInmlYjjgIInLFxuICAgIGxpbms6IGAke3dpbmRvdy5sb2NhdGlvbi5wcm90b2NvbH0vLyR7d2luZG93LmxvY2F0aW9uLmhvc3R9L3d4JHtNYXRoLmNlaWwoTWF0aC5yYW5kb20oKSAqIDEwMCl9P19yPSR7c2hhcmVGbGFnfWAsXG4gICAgaW1nVXJsOiAnaHR0cHM6Ly9zdGF0aWMtYXBwLjk3a2lkLmNvbS9zaXRlLXN0dWRlbnQvcHVibGljL2ltZy9zaGFyZS5wbmcnXG4gIH0pXG59XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIC4vcHVibGljL21vYmlsZS9jYW1wYWlnbi92ZXJpZnkvZXM2L3ZlcmlmeS5qcyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n");

    /***/
  },

  /***/9:
  /***/function _(module, exports, __webpack_require__) {

    module.exports = __webpack_require__(10);

    /***/
  }

  /******/ });